he also used a comma in the for loop. it needs a;
the format is
for(init; condition; action)
for(init, condition, action)
for(...); is not a language error: it does nothing many times and then does what follows once.
this is a nasty silent bug, and so commonly done that all good compilers warn you about it.
once it compiles review your warnings and you will see what I mean. Then fix it by removing the ;.