Lets say I have
int j = 23;
for (j < 20; j++) {
//do stuff
}
I know it seems stupid in this context but is this possible? Or do you have to do
int j = 23;
for (j; j < 20; j++) {
//do stuff
}
You'd typically use an empty initializer:
for (; j < 20; ++j)
Granted, it's just an example, but if j is initialized 23, the for loop will never execute at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With