C++ post and pre

Programming
Tutor: None Selected Time limit: 1 Day

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

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
May 10th, 2014
...
May 10th, 2014
Dec 7th, 2016
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