so I am looking at the following snippet of code
int a = 3;
int b = 2;
b = a++;
cout << ++b;
My understanding line by line is:
- initiate a = 3
- initiate b = 2;
- assign the value of (a+1) to b, so b = 4;
- print b+1, which is 5.
However this is wrong, can someone explain this in simple terms? I am new to C++