Consider the SO question hosted for Java. How does the +++ operator work?
Ok i understand that
- There is no operator like "+++", its just a incremental increment followed by the add infix
- This is a crime against readability.
What I want to know (just for the sake of curiosity) IF
+++ its just a incremental increment followed by infix, add , and not +++ its just an incremental infix followed by a prefix increment or its undefined behavior .
Note that I tested the following program
#include <iostream> int main() { int x = 1; std::cout<< x+++1 << std::endl; std::cout<< 1+++x << std::endl; }
in VC ++, gcc and g ++, and they all correspond to what
'+++' its just a post-fix increment followed by an infix add
but not
'+++' its just an infix add followed by a prefix increment
Abhijit
source share