From 868be425a6602020f275404a8776d48f3d6d2715 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 20 Sep 2013 22:31:04 -0500 Subject: Add to notes on increment and decrement operators. --- c.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'c.html.markdown') diff --git a/c.html.markdown b/c.html.markdown index f1e328cf..f67f6c4a 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -205,8 +205,11 @@ int main() { 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. - s[++j]; //increments value of j THEN returns value of j to s. + char *s = "iLoveC" + int j = 0; + s[j++]; // => "i" Returns value of j to s THEN increments value of j. + j = 0; + s[++j]; // => "L" Increments value of j THEN returns value of j to s. // same with j-- and --j // Bitwise operators! -- cgit v1.2.3