summaryrefslogtreecommitdiffhomepage
path: root/c.html.markdown
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2013-08-31 15:57:18 -0500
committerLevi Bostian <levi.bostian@gmail.com>2013-08-31 15:57:54 -0500
commitb0c5ca0a1cc5a62fc8569fffffcdf35bf44e8dc8 (patch)
tree3e1010c60f7773eb4e5d6eb2157be1ad84faa82b /c.html.markdown
parentf1b1fd8e2efd6c30e553aae1c4f6cc28a6554e8f (diff)
Add note about loops C
Diffstat (limited to 'c.html.markdown')
-rw-r--r--c.html.markdown6
1 files changed, 6 insertions, 0 deletions
diff --git a/c.html.markdown b/c.html.markdown
index 869ab984..166c43e6 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -231,6 +231,12 @@ int main() {
printf("I print\n");
}
+ // Notes:
+ // Loops MUST always have a body. If no body is needed, do this:
+ for (i = 0; i <= 5; i++) {
+ ; // use semicolon to act as the body (null statement)
+ }
+
// While loops exist
int ii = 0;
while (ii < 10) {