1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-12 01:34:19 +02:00

Add note about loops C

This commit is contained in:
Levi Bostian
2013-08-31 15:57:18 -05:00
parent f1b1fd8e2e
commit b0c5ca0a1c

View File

@@ -231,6 +231,12 @@ int main() {
printf("I print\n"); 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 // While loops exist
int ii = 0; int ii = 0;
while (ii < 10) { while (ii < 10) {