mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-01 04:20:39 +02:00
Declare variable before empty for loop.
This commit is contained in:
@@ -264,6 +264,7 @@ int main() {
|
||||
|
||||
// *****NOTES*****:
|
||||
// Loops MUST always have a body. If no body is needed, do:
|
||||
int i;
|
||||
for (i = 0; i <= 5; i++) {
|
||||
; // use semicolon to act as the body (null statement)
|
||||
}
|
||||
|
Reference in New Issue
Block a user