Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>++ increment operator (prefix and postfix)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ++                      Increment Operator (prefix and postfix)

 lvalue++                postfix increment
 ++lvalue                prefix increment
 lvalue                  any variable of type int, float, pointer, char,
                         enum, or related type

    The unary postfix operator ++ increments (adds one to) lvalue after
    the expression containing lvalue has been evaluated. For example:

             j = 10; i = 5 * j++; /* i == 50, j == 11 */

    The unary prefix operator ++ increments lvalue before the expression
    containing lvalue has been evaluated. For example:

             j = 10; i = 5 * ++j;  /* i == 55, j == 11 */

       Note:    In the case of pointers, ++ moves the pointer to the next
                element.  For example, if ptr is a pointer to a 4-byte
                long, ptr++ actually adds 4 to ptr, thereby aiming it at
                the next 4-byte long, not at the next byte.  Incrementing
                a pointer to char always adds 1, on any machine.

                For pointers, both *(++lvalue) and lvalue[1] fetch the
                same element.


See Also: --

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson