cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Increment variations
Increment variations
Jan 6, 2013 at 8:22pm UTC
Bolong Yu
(73)
How to use increment? And what difference dose the position of the increment operator, ++ make? Ex:K=j++ and k=++j.
Jan 6, 2013 at 8:28pm UTC
Pickle Gunner
(139)
i = n++;
would set i to the original value of n i.e. 5 and would then increment n to 6. Whereas
i = ++n;
would increment n to 6 and then set i to 6.
http://www.macs.hw.ac.uk/~pjbk/pathways/cpp1/node65.html
Topic archived. No new replies allowed.