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 Reply Children
  • Ok, blasted might be an extreme word. But it's a straight forward question. Basically, does he (or you, if you take issue with the question) think people who make mistakes deserve any grace or should they immediately be berated for making a (easy enough) mistake? I'm just trying to make a point that there's a difference between laziness and making a mistake. If you believe that people who make mistakes should be given no grace and should be treated as if they're lazy, fair enough. If you differentiate between the two, that's fine too. I was just curious and just wanted a straight answer.

  • Well - my post did contain the text:

    "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?"

    Then I did give the pertinent information to the problem with the code.

    So should we not point out the issue with formatting, when the code in question have an error that do relate specifically to scoping rules - something that indentation rules was created to better highlight?

  • Forget that for now, I think we've beat that horse into the ground. What I'm trying to understand is the perception of how people post here (not you so much, I'm actually more interested in hearing Erik's reply to this one), whether it's read as laziness regardless or if there's any consideration that a person could simply have made a mistake. It's a very, very specific, direct question. It's not difficult to answer. Answer it if you want or ignore it.

    Do you think people who make mistakes deserve any grace or should they immediately be berated for making a mistake when posting here, regardless of circumstances of the mistake?

    I'm not talking about in context to THIS situation (we've gone over it over and over). I'm talking about in general. Is the possibility of someone making a mistake even a factor in responses or should anyone who makes a mistake be treated as if they're just being lazy?

  • Heh, on a sidenote, it's pretty amusing that there are now 53 responses to a one line piece of code that was merely missing a semicolon . . . :)

  • No - I'm pretty sure the code missed two (2) semicolons.

  • whether it's read as laziness regardless or if there's any consideration that a person could simply have made a mistake. It's a very, very specific, direct question. It's not difficult to answer. Answer it if you want or ignore it.

    I really would not think of it as 'laziness' but more like "lack of interest in doing right". In todays society there is waaaaay too much of "if I do not do what I'm supposed to, so what, it is not politically correct to berate me"

    Erik