0

Who can explain?

int x=0; int &y=x;y=5; while (x <=5){ cout <<y++; x++; } cout <<x;

30th Jan 2017, 8:30 PM
dima x
dima x - avatar
1 Antwort
+ 5
Output: 57 int &y=x; //y is a referenece to x. Simply y and x are now the same variable. y=5; //now x is equal to 5
30th Jan 2017, 8:58 PM
Jafca
Jafca - avatar