diff options
Diffstat (limited to 'c.html.markdown')
-rw-r--r-- | c.html.markdown | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/c.html.markdown b/c.html.markdown index 8d4cfd93..bfdf276c 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -54,6 +54,8 @@ int function_2(void); // Must declare a 'function prototype' before main() when functions occur after // your main() function. int add_two_ints(int x1, int x2); // function prototype +// although `int add_two_ints(int, int);` is also valid (no need to name the args), +// it is recommended to name arguments in the prototype as well for easier inspection // Your program's entry point is a function called // main with an integer return type. @@ -235,7 +237,7 @@ int main (int argc, char** argv) 0 || 1; // => 1 (Logical or) 0 || 0; // => 0 - // Conditional expression ( ? : ) + // Conditional ternary expression ( ? : ) int e = 5; int f = 10; int z; @@ -305,6 +307,8 @@ int main (int argc, char** argv) for (i = 0; i <= 5; i++) { ; // use semicolon to act as the body (null statement) } + // Or + for (i = 0; i <= 5; i++); // branching with multiple choices: switch() switch (a) { |