Parse Error?

Started by
25 comments, last by IRDumb 22 years, 7 months ago
Whenever I try and compile my code on dev-cpp, I get all these parse error, like on my bracket ({) or something. It says something like this... parse error before ''<'' parse error before ''['' and so on... What is going on?
Advertisement
You haven''t given enough information for anybody to help you specifically. The only advice I can give is to start at the top of your error list, not the bottom.

~deadlinegrunt

Ok, well try this...

(I just did this right now in my compiler, dev)

#include
void main()
{
int age
cout<<"hello world\n";
cout<<"how old are you?\n";
cin>>age;
cout<<"you are"<}

The only error I got was "parse error before `<''" in line 5.
Also, when I said, "execute" nothing happened, even though the
box was saying execute.

cout<<"you are"<} should be cout<<"you are";}

Invader X
Invader''s Realm
Oops, that was a mistake.
That line should read...

cout<<"you are"<}
You need to put a semi-colon ";" after int age...

Also, use the tags [ source ] and [ /source ] (without the extra spaces) around any code you post so it doesn''t think the less than/greater than signs are HTML.

Anthracks
Hmm, you should read the FAQ. It explains how to post code without having things get eaten by HTML by using certain special tags. I forget what they are at the moment.

As far as the code you posted, it looks like you''re missing a ; on line 4 after "int age". With C/C++, when the compiler gives an error on a specific line, the problem isn;t necessarily on that line. Often incorrect code on previous lines can''t be detected and reported by the compiler until it reachs a point on a later line.
Ok, thanks
After the semicolon it was fine, so I guess I just miss semicolons and stuff. And I''ll do that
    
next time too.
Now another thing-
*Why does''t the program execute even after I compile it no errors? What happens is I click execute, and the top blue status/tool bar thing goes from blue to gray and then returns?
It is executing, it is just finishing because it doesn''t have to wait for anything. Make it get input or wait at the end of the program, then it won''t close when it''s done.

[Resist Windows XP''s Invasive Production Activation Technology!]
How do I make it wait?
I am not using return 0; or anything

This topic is closed to new replies.

Advertisement