+ 1

can somebody explain this?

can some one please explain this code to me? int a=3; int b=2; b=a++; cout<<++b;

24th Jun 2018, 2:18 PM
Seth Christie
Seth Christie - avatar
2 Réponses
+ 1
first a is 3 b is 2 and then b is exchange to a++ ( its a increment ) now, a is 4 b is 3 cout<<++b = cout<<4 the answer is 4
24th Jun 2018, 2:22 PM
Blizz
Blizz - avatar
0
thanks blizz
24th Jun 2018, 2:54 PM
Seth Christie
Seth Christie - avatar