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
  • In this case, more important than the "pre" thing is proper indentation.

    You're really not getting it. That "pre thing" is needed to to do keep that indentation of pasted source code!

    I.e. if you copy-paste some nicely formatted code into the new-message window, but ignore putting it into "pre" tags, what you get is exactly that kind of all-in-one-line, unindented mess that the original posting was.

    You didn't seriously believe that all those nonsensical, unformatted source code examples weg get in here originally looked that way before being copy-pasted into the forum, did you?

Reply
  • In this case, more important than the "pre" thing is proper indentation.

    You're really not getting it. That "pre thing" is needed to to do keep that indentation of pasted source code!

    I.e. if you copy-paste some nicely formatted code into the new-message window, but ignore putting it into "pre" tags, what you get is exactly that kind of all-in-one-line, unindented mess that the original posting was.

    You didn't seriously believe that all those nonsensical, unformatted source code examples weg get in here originally looked that way before being copy-pasted into the forum, did you?

Children
  • Chill out, man. You're heart is going to explode from high blood pressure over a really tiny misunderstanding . . .

    I don't know what the person put in originally. For all you know, he does write all his code in one line. I also don't know how these forums handle those "pre" things because I usually put in pre-formatted code and use those stupid "pre" thingies, as the forum specifies. I didn't try putting in formatted and unformatted code, just to understand how these forums handle it.

    I could swear, some of you guys go LOOKING for arguments and I just don't get it. Pick your battles. You can find something wrong with just about every post if you look at them intently enough. Is it really that important to you?

    Congrats, I was wrong. You win the internets. Feel better?

  • I don't know what the person put in originally.

    You see, that's the difference: we actually do, to a high level of certainty, from experience that you apparently don't have.

    I also don't know how these forums handle those "pre" things because I usually put in pre-formatted code and use those stupid "pre" thingies, as the forum specifies. I didn't try putting in formatted and unformatted code, just to understand how these forums handle it.

    Yet you took it upon yourself to accuse us of inappropriate comments, and of concentrating on little things while ignoring the big issues. If you start your end of a conversation like that while the well-known facts contradict your position, you can't seriously expect to be congratulated for your efforts.

  • Chill out, man. You're heart is going to explode from high blood pressure over a really tiny misunderstanding
    First I do not think Hans-Bernhard is at the level of an exploding hart, he is just annoyed about the people that want help but do not have the courtesy to make it as easy as possible to help them.
    Second, nobody has run this post because of "a really tiny misunderstanding" but instead beacuse of your need to comment on lack of "political correctness". If you want help, welcome, if you want to *** about "political correctness" please stay away. Many of us are willing to help; however, we help as we see fit not as some bleeding heart think we should.

    Erik

  • What was wrong with my response? He has three posts nitpicking about how people should post while adding nothing to what is actually wrong with the original code and I'm the ass? I'm not getting on his case for political correctness purposes (I get that many people don't put in enough effort, it's well documented in the 10 posts before his), I'm on his case for picking fights.

    Why am i getting grief? Because I'm not just sitting there and taking the shots he throws at me because he's an "experienced" programmer and he assumes I'm not because I don't know the inner workings of these particular forums?

  • What was wrong with my response?
    That you raised an insignificat issue after the OP had his question answered

    He has three posts nitpicking about how people should post
    sure, since you raised the issue
    while adding nothing to what is actually wrong with the original code
    sure, that was answered in the first post, then after your 'response' it became about your nitpick
    and I'm the ass?
    you said it

    Erik

  • What was wrong with my response?

    Partly, that it looked and felt so much like "Trever Morgan"'s earlier contribution that I mixed you two guys up. Sorry for that. It was hime who complained about inappropriate replies, not you.

    He has three posts nitpicking about how people should post while adding nothing to what is actually wrong with the original code

    What, and you didn't?

    If you bothered to actually look, you would find that I only responded to posts by you and others that had already gone down that route, and I did so in order to correct some factual mistakes in those posts.

    and I'm the ass?

    Nobody said anything like that.

    Why am i getting grief? Because I'm not just sitting there and taking the shots he throws at me because he's an "experienced" programmer and he assumes I'm not because I don't know the inner workings of these particular forums?

    ... nor that. The latter you said yourself, but nobody disclaimed your experience as a programmer because of it.

    So let's see, you're making up things I'm supposed to have done to you, and I'm the one picking fights here? Really?

  • "He has three posts nitpicking about how people should post while adding nothing to what is actually wrong with the original code and I'm the ass?"

    Who is "he"? I have several posts commenting on how people should post. But I also have other information in the posts - if the original post had enough contents to make it possible/meaningful.

  • Sounds like most of this comes as a result of the confusion between me and the morgan guy but for all intent and purposes, let me explain where I get this from, so you understand I wasn't making anything up . . .

    If you bothered to actually look, you would find that I only responded to posts by you and others that had already gone down that route, and I did so in order to correct some factual mistakes in those posts.

    While this is true, I saw it as you jumped in only when people were already heading down that direction. It seemed like you came out of nowhere to just jump on people over the way they post and were never interested in helping out with the original code.

    That's probably a bit unfair of an analysis on my part but that was my reaction to it. Sorry about that.

    Nobody said anything like that.

    Maybe ass was the wrong word but the point of the statement is that I was being made to look like the jerk for defending my statements about nitpicking (which, as you mentioned was a result of my posts looking like Morgan's), more by Erik than yourself.

    ... nor that. The latter you said yourself, but nobody disclaimed your experience as a programmer because of it.

    You see, that's the difference: we actually do, to a high level of certainty, from experience that you apparently don't have.

    This statement right here implied inexperience (though I guess in context to the forums themselves, I looked too far into this regarding my own embedded experience). So that was a misunderstanding on my part, I wasn't trying to make anything up.

    So, long story short, a series of misunderstandings and it all headed off on some complete unnecessary tangent that distracts from the original posts. Though, to be fair, in all the time this has taken, the OP still hasn't bothered to come in here and follow up with any updates so I guess it's all a moot point. Unless the Nirav person is the same as the Morgan guy . . .

  • Heh, doesn't matter at this point. It looks like its an escalating series of misunderstandings.