From b0c5ca0a1cc5a62fc8569fffffcdf35bf44e8dc8 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 31 Aug 2013 15:57:18 -0500 Subject: Add note about loops C --- c.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'c.html.markdown') 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) { -- cgit v1.2.3