Advertisement

parse errors?

Started by June 20, 2002 09:40 PM
2 comments, last by RegaRIP 22 years, 4 months ago
I''m getting a "parse error at end of input" for this simple program #include <iostream.h> #include <stdlib.h> #include <string> #include <fstream.h> #include "Stack.h" int main(int argc, char *argv[]) { stack S(20); return 0; } I''m more curious what the main cause of parse errors is, rather than whats wrong with my code...I''m just learning so this will help me for future Thanks in advance
->What part of "Stack.h" gives the error?
______________________________Only dead fish go with the main-stream.
Advertisement
Parse errors are caused by errors in your code's syntax. Missing ; are a major culprit of this. Misspelled variable and function names can cause them too (among other things).

BTW, iostream.h is NOT a standard C++ header. You should use < iostream > instead and add
 using namespace std;    
after your includes. < iostream.h > != < iostream >. In fact, VC .NET will complain loudly if you use iostream.h, saying that it's depricated.

/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/

[edited by - Chem0sh on June 21, 2002 5:06:58 PM]

[edited by - Chem0sh on June 21, 2002 5:07:43 PM]
/*=========================================// Chem0sh// Lead Software Engineer & Tech Support// http://www.eFaces.biz=========================================*/
quote: Original post by Chem0sh
BTW, iostream.h is NOT a standard C++ header.

Ditto fstream.h (replace with <fstream>, which, along with <iostream>, works with <string>). <cstdlib> instead of <stdlib.h>, and for anything other than learning purposes, use <stack>.

This topic is closed to new replies.

Advertisement