| C Tutorial | Pre and post variations | |||
|
Introduction to C language Integer types Char constants Int constants Type combination and promotion Int overflow Floating point types Comments Variables Assignment operator Truncation Int vs float arithmatic Mathematical operators Unary Increment Operators Pre and Post Variations C Programming Cleverness and Ego Issues Relational Operators Logical Operators Bitwise Operators Other Assignment Operators
|
The Pre/Post variation has to do with nesting a variable with the increment or decrement operator inside an expression -- should the entire expression represent the value of the variable before or after the change? I never use the operators in this way (see below), but an example looks like...
int i = 42; int j;
j = (i++ + 10); // i is now 43 // j is now 52 (NOT 53)
j = (++i + 10) // i is now 44 // j is now 54
Want more information and Video ???
|
|