I don't know if theres a difference between x++ and x += 1, but there is a difference between the post and pre-increment operators. ++x is actually faster than x++ since the latter requires the original values of x to be stored in a temporary variable and then returned. This is not so much a problem with primitives like int etc since the compiler will optimize it anyway.
Note that C does not allow user defined operator overloading.Originally Posted by rocketman03
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I read a while ago that, for modern x86 processors, "add some_register, 1" is actually faster than "inc some_register". As a result, GCC will never generate the "inc" instruction, at least if you tell it to optimize for any modern processor.