C++ post and pre

label Programming
account_circle Unassigned
schedule 1 Day
account_balance_wallet $5

what is the mean of post and pre increment /decrement in c++

May 10th, 2014

Increment and decrement operators are unaryoperators that add or subtract one from their operand, respectively. They are commonly implemented inimperativeprogramming languagesC-like languages became notorious for featuring two versions (pre- and post-) of each operator with slightly different semantics.

Examples

int  x;
int  y;
 
// Increment operators
x = 1;
y = ++x;    // x is now 2, y is also 2
y = x++;    // x is now 3, y is 2
 
// Decrement operators
x = 3;
y = x--;    // x is now 2, y is 3
y = --x;    // x is now 1, y is also 1


May 10th, 2014

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
May 10th, 2014
...
May 10th, 2014
Jun 23rd, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer