We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
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 . . .
Per,
Remember earlier on I tailed a response with:
I'm sure you and your cohorts will have a view on what I have said, but remember that you did ask!
You asked, I answered. Then followed an extraordinary amount of bitching. Now look back at my original post. Was all that bitching really justified from that post or was it all from my second post? Remember, the one you asked for. Were you just looking to find fuel for the fire?
You missed the point entirely!
The point is that the inability to follow simple, clearly-stated instructions is symptomatic of a fundamental problem in the OP's approach.
I think their point is, yes, if that was the only person to ever post here and they only had to answer that one question, it's readable.
But since many people come here asking for help with bad formatting, they're trying to make a consistent rule to have everyone format it a certain way. This time it might not matter (even though expanding it in THIS case very easily shows the issue with the code) but if they don't correct the person now, they might come back with more complicated code next time and not format it correctly and no one will be able/willing to help him.
It serves multiple purposes:
1) To possibly help the person posting the code by being able to look at it formatted correctly (though if it's being posted here, it's unlikely that's going to be the case) 2) To make it easier for the people providing help to read it 3) To show a basic level of consideration/consistency when posting. If the person is unwilling to follow directions THAT specifically outlined (and reinforced by multiple posters here), it's unlikely that any help provided will be able to help the person a) solve their problem or b) become a better programmer.
The posters here are trying to help people find the problems and UNDERSTAND what they're solving, not to simply hand them a solution without them UNDERSTANDING what the problem is.
So yeah, you can argue all you want about it, you could even be right about it but at the end of the day, if the people providing you help ask for something, you can question or fight them about it (and end up in the huge tangent displayed here) or you can just follow their suggestion and move on and I'm sure they'll be happy to help you with your code at that point.
But realistically, if you try to help someone and they fight you over it, how likely are you to continue helping someone?
Heh, doesn't matter at this point. It looks like its an escalating series of misunderstandings.
I see this response going badly . . .
No. I was replying to your rather sloppy description of what matters to a compiler.
"Was all that bitching really justified from that post or was it all from my second post? Remember, the one you asked for."
And if you read my posts - please show where I have bitched. I have given reasons why that pre tag matters even for this small code example.
And if you read my posts - please show where I have bitched.
I said "Then followed an extraordinary amount of bitching." I did not say the bitching was from you.
There were a small number of sensible responses, but would you deny that a few old regulars jumped on the bandwaggon? You know, those cohorts. Did you read some of the things they said? I see a few of those as not being just wrong, but also being outrageous. Nothing actually being said, just people looking for an excuse to say something, anything really. And some clearly just wanting to belittle.
Now I will not say any more on the matter. Maybe this post will trigger another flurry of outrageous comments. I may read them, to see if anything useful is added, but I'm not going to drawn in by any more 'what do you think about that' traps from you.
"[...] but I'm not going to drawn in by any more 'what do you think about that' traps from you."
So - what traps have I laid? Why you blame me if you get into troubles in a thread?
You worry about threads going down the drain. Still you use colored words like "sloppy", "traps" etc. Why am I suddenly thinking about kettles and black?
Tut-Tut.
#include<reg51.h> void main ( ) { int x; while (1) { P1 = 0x00 ; for (x=0 ; x<=5000 ; x++) { P1 = 0xFF ; }
} }
suresh, suresh, suresh. suresh, suresh, suresh.
Did you read the posts above? What was the main complaint about you original post? did you actually fix the problem?
Not same name as OP.
And a program that (most probably) have the same problem with the first for() loop. And solved the problem with the second for() loop by removing it.
That might even have been a valid argument, were it not for the fact that what is shown here was shown on the OP's screen first. That's exactly what the preview-before-post mechanism was created for.
So the OP did see that the formatting was shot, and decided to post it as broken as it was.
Lesson learned: before you blame others, try to get your facts straight.
The op might not of seen what you think chum.
You do not always see the full preview of what your going to post with the preview-before-post mechanism. Just try entering some text, previewing, then entering more text. Now the post button is visible and enabled. So the op could of entered his text, then previewed, then pasted in his code and posted without seeing how bad it looked.
Lesson learned: before you state what you think is a certainty, try to get your facts straight.