-
You are still missing several semi-colons at the end of statements.
The only lines that should NOT have a semicolon at the end are:
- Lines that start with #.
- Function definition name [e.g. main()] and the arguments to functions if they are on separate lines.
- Comments.
- Lines using keywords do, while, if, for [excepf it you write code like this:
- Lines that contain braces [assumimg you put braces on their separate lines - which is a good thing to do].
I've probably missed out one or two - but the concept is "most lines end with semicolon", some don't. [Ok, so technically, the LINE isn't ended with a semicolon, the statement is. But unless you have complicated/long statements, e.g. long calculations, a statement is the same as a line.
And you are missing some, and that's confusing the compiler - a bit like saying "Turn right at the big tree", when someone has cut down "the big tree", you'd get pretty lost when you turn at the next big tree you see - which is obviously not where you were supposed to turn. In this case, the compiler expects a semicolon at some point - but it finds the next "thing" - and the compiler doesn't quite know what is wrong, just that "This doesn't look at all like what I expected to see" - just like what would happen if you turn "a big tree later".
--
Mats
-
Code:
for ( mph <= 80; mph += increment ) ; <-- why do you need this?? take this out
orbetter move it inside brackets :P)
for needs 3 statements
Code:
for(mph=0 ; mph <= 80; mph += increment )
you can leave out first statement
you cannot loose the ;