This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TOGGLE.C(10): error C141: syntax error near '}'

i am facing error C141: syntax error near '}'

my program is given below:

#include<reg51.h>
void main ( )
{ int x; while (1) { P1 = 0x00 ; for (x=0 ; x<=5000 ; x++) P1 = 0xFF ; for (x=0 ; x<=5000 ; x++) } }

any one can help me how to solve it

Parents
  • "I was trying to say that being fixated with the small things at the expense of the big things is a particularly dumb thing."

    Not when the little thing is a ';'.

    But what is your view on the first for() loop in the posted code? Did the OP intend it as a empty for loop for a delay? Or a loop that should perform multiple writes of 0xFF to the port? Is there a way we can know, without seeing the code complete with the original indentation? Does it make a big difference in the result, when running the code?

    By the way - compare posting time of my first answer with the creation time of this thread. And remove time for writing the text. I obviously can't have spent too much time on that mess, to pinpoint the issues. But does that make it less of a mess, because of the lack of indentation?

Reply
  • "I was trying to say that being fixated with the small things at the expense of the big things is a particularly dumb thing."

    Not when the little thing is a ';'.

    But what is your view on the first for() loop in the posted code? Did the OP intend it as a empty for loop for a delay? Or a loop that should perform multiple writes of 0xFF to the port? Is there a way we can know, without seeing the code complete with the original indentation? Does it make a big difference in the result, when running the code?

    By the way - compare posting time of my first answer with the creation time of this thread. And remove time for writing the text. I obviously can't have spent too much time on that mess, to pinpoint the issues. But does that make it less of a mess, because of the lack of indentation?

Children
No data