Horje
pre increment vs post increment c++ Code Example
pre-increment vs post-increment
++x (pre-increment) means "increment the variable; the value of the expression is the final value"
x++ (post-increment) means "remember the original value, then increment the variable; the value of the expression is the original value"
pre increment vs post increment c++
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.




Cpp

Related
concat two vectors c++ Code Example concat two vectors c++ Code Example
C++ loop maker Code Example C++ loop maker Code Example
c++ shared pointer operator bool Code Example c++ shared pointer operator bool Code Example
c++ region Code Example c++ region Code Example
flutter text direction auto Code Example flutter text direction auto Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9