Add to ? : example in C.

This commit is contained in:
Levi Bostian 2013-09-20 22:19:07 -05:00
parent f471616ccb
commit ec7ee88698

View File

@ -199,8 +199,10 @@ int main() {
0 || 0; // => 0
//Conditional expression ( ? : )
int a, b, z;
z = (a > b) ? a : b; // "if a > b return a, else return b."
int a = 5;
int b = 10;
int z;
z = (a > b) ? a : b; // => 10 "if a > b return a, else return b."
//Increment and decrement operators:
s[j++]; //returns value of j to s THEN increments value of j.