[Main]
Title=Increment operator ('++')
Index=++

[Top]
The increment operator may be used as a postincrement or preincrement operator:
<PRE><I>expr</I> ++           (postincrement)
++ <I>expr</I>           (preincrement)
</PRE>
The expression is called the operand; it must be of scalar type (arithmetic
or pointer types) and must be a modifiable <A HREF="$$LINK(lvalue)">lvalue</A>.
<BR><BR>
When postincrement operator form is used, the value of the whole expression is the
value of the postfix expression before the increment is applied.
After the postfix expression is evaluated, the operand is incremented by 1.
<BR><BR>
When preincrement operator form is used, the operand is incremented by 1 before the
expression is evaluated; the value of the whole expression is the incremented value
of the operand.
<BR><BR>
The increment value is appropriate to the type of the operand.
Pointer types follow the rules for pointer arithmetic. In other words, the actual
address on which a pointer points to is incremented by the size of the pointed object
(not by 1, except if the pointed object is one byte long), so after the incrementing, the
pointer points to the next object in a sequence (e.g. to a next element in an array, etc.).
<BR><BR>
<B>Note:</B> GNU C extends the pointer arithmetic to be valid even on void pointers and pointers to
functions (see <A HREF="$$INFOLINK(gnuexts/SEC79)">extended pointer arithmetic</A> for
more info).
