8. References

Question.5

A developer tries to switch a reference between two sensor channels:

int ch1 = 100, ch2 = 200;
int &active = ch1;
active = ch2;  // Trying to rebind to ch2
printf("%d %d %d", ch1, ch2, active);

What is the output?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!