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
  • But why can you not use the correct formatting so we get to see a properly intended source code? Didn't you check the information directly above the message input box?

    Back to your - very hard to read - code: What should a for loop do if you have nothing for it to do? Can a for loop be totally without statement - what does your C programming book say?

    Another thing - what use is it to make 5001 assigns of P1 = 0xFF directly after each other? Exactly how do you think P1 = 0xFF interacts with the for loop?

    Pers reply quoted above DOES inform the OP what the problem is (I guess that qualifies as the "big thing")

    and you react to the comment about missed formatting (I guess that qualifies as the "small thing")

    now you post
    I was trying to say that being fixated with the small things at the expense of the big things is a particularly dumb thing
    I think the pot is calling the kettle black

    Erik

Reply
  • But why can you not use the correct formatting so we get to see a properly intended source code? Didn't you check the information directly above the message input box?

    Back to your - very hard to read - code: What should a for loop do if you have nothing for it to do? Can a for loop be totally without statement - what does your C programming book say?

    Another thing - what use is it to make 5001 assigns of P1 = 0xFF directly after each other? Exactly how do you think P1 = 0xFF interacts with the for loop?

    Pers reply quoted above DOES inform the OP what the problem is (I guess that qualifies as the "big thing")

    and you react to the comment about missed formatting (I guess that qualifies as the "small thing")

    now you post
    I was trying to say that being fixated with the small things at the expense of the big things is a particularly dumb thing
    I think the pot is calling the kettle black

    Erik

Children
No data