summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2013-09-20 22:19:07 -0500
committerLevi Bostian <levi.bostian@gmail.com>2013-09-20 22:19:07 -0500
commitec7ee88698bf32bfe6e931865e94d2dac8f41c80 (patch)
tree55fac897e36a34c19a7dc434abd227049cba322a
parentf471616ccb97e5fd32393f1f408394cfebe0d151 (diff)
Add to ? : example in C.
-rw-r--r--c.html.markdown6
1 files changed, 4 insertions, 2 deletions
diff --git a/c.html.markdown b/c.html.markdown
index df6cd036..f1e328cf 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -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.