+ 1

In this program we have the following " lines ":

int a=3; int b=2; b=a++; cout <<++b; my question is, why we have here ++b and not simply b ?? ThNks!

31st Jan 2017, 12:16 PM
Maho Anchi
Maho Anchi - avatar
4 odpowiedzi
+ 5
cout<<b; //output: 3 cout<<++b; //output: 4
31st Jan 2017, 12:22 PM
Jafca
Jafca - avatar
+ 3
It's not that the program above is wrong...
31st Jan 2017, 12:20 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 1
Thank you guys
31st Jan 2017, 12:25 PM
Maho Anchi
Maho Anchi - avatar
0
whats the mistake?
31st Jan 2017, 12:22 PM
Maho Anchi
Maho Anchi - avatar