brand new to c++ and having a problem wit some experimental coding

This is a discussion on brand new to c++ and having a problem wit some experimental coding within the C++ Programming forums, part of the General Programming Boards category; a++ is just like doing: a=a+1; ++a is just like doing: a+1=a; decrement is no different, I am sure you ...

  1. #16
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    a++ is just like doing:

    a=a+1;

    ++a is just like doing:

    a+1=a;

    decrement is no different, I am sure you get the picture.

  2. #17
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    That is not correct. Both a++ and ++a are the same as a = a + 1. The difference is in the value they return: a++ returns a before the increment, ++a returns a after the increment.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21