The post-increment operator increments the operand AFTER it is evaluated. It's as simple as that.

You have to be careful using these operators multiple times on one operand in one expression. Such usage can result in undefined operation, wherein your compiler can do anything it likes. Read about sequence points.

Incidentally, your original example is not an example of a "strcpy", it's an example of a "strdup", which gets memory from the heap and makes a copy using it.

Last edited by DaWei; 9Feb2007 at 03:42..