1 | initial version |
i guess, this is more an ordinary c++ problem, by convention,
the int arg in the latter is a dummy, you're not supposed to supply something there (and how would you even?)
the difference between them is the order of evaluation and increment, it's the same as with plain pointers:
int X[] = { 3,4,5,6 };
int *x = X;
cerr << *(x++); // prints 3, first eval, then increment
cerr << *(++x); // prints 5, first increment, then eval
2 | No.2 Revision |
i guess, this is more an ordinary c++ problem, by convention,
the int arg in the latter is a dummy, you're not supposed to supply something there (and how would you even?)
the difference between them is the order of evaluation and increment, it's the same as with plain pointers:numbers:
int X[] x = { 3,4,5,6 };
int *x = X;
3;
cerr << *(x++); (x++); // prints 3, first eval, then increment
cerr << *(++x); (++x); // prints 5, first increment, then eval
3 | No.3 Revision |
i guess, this is more an ordinary c++ problem, by convention,
the int arg in the latter is a dummy, you're not supposed to supply something anything there (and how (how would you even?)
the difference between them is the order of evaluation and increment, it's the same as with plain numbers:
int x = 3;
cerr << (x++); // prints 3, first eval, then increment
cerr << (x); // prints 4 ;)
cerr << (++x); // prints 5, first increment, then eval