Add conditinal expression (?:) to C.

This commit is contained in:
Levi Bostian 2013-09-01 11:51:25 -05:00
parent 2fab4dc971
commit 0ab144ff97

View File

@ -226,6 +226,10 @@ int main() {
0 || 1; // => 1 (Logical or) 0 || 1; // => 1 (Logical or)
0 || 0; // => 0 0 || 0; // => 0
//Conditional expression ( ?: )
int a, b, z;
z = (a > b) ? a : b; // z = max(a, b);
//Increment and decrement operators: //Increment and decrement operators:
int j = 0; int j = 0;
char s[]; char s[];