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