Question : pre increment vs post increment c++
Answered by : thankful-tarantula-crt7kp1faghn
b = x++;
// In this example suppose the value of variable ‘x’ is 5 then value of variable ‘b’ will be 5 because old value of ‘x’ is used.
b = ++y;
// In this example suppose the value of variable ‘y’ is 5 then value of variable ‘b’ will be 6 because the value of ‘y’ gets modified before using it in a expression.
Source : https://stackoverflow.com/questions/16869020/pre-increment-vs-post-increment-in-array | Last Update : Sun, 14 Nov 21