#include <stdio.h>
int main(int argc, char **argv) {
int a[2];
int b[2];
int i;
a[0] = 1; a[1] = 2;
b[0] = 1; b[1] = 2;
i = 0; if( a[i++] == a[i] ) printf("yep\n");
i = 0; if( a[++i] == a[i] ) printf("yep\n");
i = 0; if( a[i++] == b[i] ) printf("yep\n");
i = 0; if( a[++i] == b[i] ) printf("yep\n");
return 0;
}
_Self&
operator++()
{
_M_node = _M_node->_M_next;
return *this;
}
_Self
operator++(int)
{
_Self __tmp = *this;
_M_node = _M_node->_M_next;
return __tmp;
}
local int a
a = 3
print a
a = a + 1
<end of scope; a is destroyed>
So, with the above in mind, the question is this: What is your preference? Do you always post-increment and then pre-increment as necessary, or do you always pre-increment and then post-increment as necessary?