Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 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, 11 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.