9 years, 10 months ago.

please help,i have a error in my code

http://developer.mbed.org/users/changzhe8387/code/temp/ this is my code ,but i can not find out the mistake ,it seem is ,i lost " ;" thank you

1 Answer

9 years, 10 months ago.

Line 90 is the culprit. it should have "} else if (..." to compile correctly. After correcting that you will find that the variable "i" is not declared. if this is declared outside the for loop it is global, if it is inside the for loop (as you have declared it) it will not be visible outside the for loop.

you have: else (Statement) { stuff; }

you should have; else if (statement) { stuff; }

From a formatting point of view your variable declarations are a little scruffy. try to use "variablename" or "VariableName" instead of "variableName". you will make less errors when typing out the variables that way.

Accepted Answer

thank you for your answer

posted by jyo tetsu 23 Jan 2015