Public Group

#### Archived

This topic is now archived and is closed to further replies.

# Parse?

This topic is 5525 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

whenever i try to compile my program, i get a parse error. What is it and how can i fix it?

##### Share on other sites
quote:
Original post by dchar3
whenever i try to compile my program, i get a parse error. What is it and how can i fix it?

How are we supposed to know if you don''t give us any details? Post the code causing the error, tell us what language it is, what compiler you are using, and what the error message is (and which line it refers to).

##### Share on other sites
What that means is you ahve some kind of _syntax_ error- that is, your program is missing something that should be there, or it has something that should NOT be there.

##### Share on other sites
[Removed. Please go to the General Programming forum for that, it is inappropriate to post it here]

[edited by - michalson on May 28, 2003 12:37:32 PM]

##### Share on other sites
Quite a common and easy parse error to make is leaving out a closing function brace. For example:

int main(){    ...    return 0;  <-- no curly brace '}'

But, as SabreMan basically said, we can only make guesses if you don't provide source code, which wastes not only our time, but yours too.

[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on May 28, 2003 12:44:32 PM]

##### Share on other sites
here it is, due to popular demand, the source code for Dev C++ 4 compiler! but i dont think its exactly right.remember im a beginner so im just trying things to see how they work.

int main()
{
cout << "I cant remember this part";
}

##### Share on other sites
quote:
Original post by dchar3
here it is, due to popular demand, the source code for Dev C++ 4 compiler! but i dont think its exactly right.remember im a beginner so im just trying things to see how they work.

int main()
{
cout << "I cant remember this part";
}

first off, that''s not a parse error.. int main() must return a value.
also- there are no other "parse" errors in that code.
if you dont post the code verbatem, then you''re pissing in the metaphorical wind.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

##### Share on other sites
That should work, so long as you have the two lines:
#include <iostream>using namespace std;
at the top of your file. Incidently, you should return an integer from main(), but it will still work as the standard says to implicitly return 0.

#include <iostream>#include <cstdlib>int main(){    std::cout << "I am testing my compiler!\n\n";    system("PAUSE");    return 0;}
Also, it seems that that is a rather old version of Dev-C++ (unless you have made a typo) you might want to download the latest.

Edit: Damn you, fast people!

[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on May 28, 2003 1:04:08 PM]

##### Share on other sites
quote:
Original post by eldee
first off, that''s not a parse error.. int main() must return a value.

Sort of. main() must indeed return a value, but keep in mind that if the main() function does not explicitly return a value, it will implicitly return 0 once control reaches the end of the function.

quote:

also- there are no other "parse" errors in that code.
if you dont post the code verbatem, then you''re pissing in the metaphorical wind.

Unless -- and this is, of course, a guess -- he forgot to #include the proper header:
#include <iostream>using namespace std; // Good for newbies ...

##### Share on other sites
quote:
Original post by dchar3
here it is, due to popular demand, the source code for Dev C++ 4 compiler! but i dont think its exactly right.

If it was exactly right, you wouldn''t be posting about a problem!
quote:

int main()
{
cout << "I cant remember this part";
}

Please post the *exact* code along with the message that your compiler produces. At the very least, you need to include iostream and namespace-qualify cout.
quote:
Original post by eldee
first off, that''s not a parse error.. int main() must return a value.

Unlike other functions, main() does not have to return a value. If no value is returned, the compiler should insert a "return 0" on your behalf.
quote:

also- there are no other "parse" errors in that code.

Well, there''s no headers, but until the OP posts what I asked for, he''s wasting everyone''s time.

1. 1
Rutin
25
2. 2
JoeJ
20
3. 3
4. 4
5. 5

• 9
• 9
• 46
• 41
• 23
• ### Forum Statistics

• Total Topics
631749
• Total Posts
3002054
×