View Full Version: easy way to add one to a variable.

C++ Learning Community > C++ Tips > easy way to add one to a variable.


Title: easy way to add one to a variable.
Description: ++variable


ih8censorship - June 23, 2003 02:03 AM (GMT)
well i forget what its called but to add 1 to a variable such as in a loop you can go ++variablename to get it to change right away or variablename++ to get it to change just a bit later. you can also use -- in the same way to subtract1 from variables.

Shadow of the Moon - June 23, 2003 05:41 PM (GMT)
They're called the increment and decrement operators

Dragon - June 23, 2003 06:22 PM (GMT)
That's why the language is "C++," which stands for "an increment better than C" or something like that.




* Hosted for free by InvisionFree