Advertisement

Problems with a tutorial I found - anyone see why?

Started by September 29, 2002 03:54 PM
5 comments, last by diggisaur 22 years, 1 month ago
Problems with a tutorial I found - anyone see why? Here is the code. ------------------------------ // Done by TheTutor -- 06/03/01 #include <conio.h> // So we can use kbhit() #include <iostream> using namespace std; int main() { // All we''re going to do is repeatedly print out a line of text until the user presses // a key do { cout << "Still in the do...while loop" << endl; } while(!kbhit()); return EXIT_SUCCESS; } // © 2001 GameTutorials ---------------------------------- The errors I get are on the line that contains return EXIT_SUCCESS; "Each declared identifier is reported only once for each function it appears in." I tried messing with it but it does not seem to work. Anyone see why?
a) list what are the identifiers causing the error
b) #include <cstdlib>



Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
I tried the code, it works fine on mine... Anyways just go:

return 0;

instead of:

return EXIT_SUCCESS;

They do the same thing anyways (Somone correct me if i''m wrong)
Thanks that worked.

I guess I should report that to the author of the tutorials.

Thanks again.
I will try using 0. Its good to know even teachers can mess up.
Yeah both your solutions worked.

Thanks.

I wonder why it did not like the EXIT_SUCCESS on my compiler.

I am using MingW. Any ideas?
Advertisement
EXIT_SUCCESS is a constant defined ( equal to zero ) in <cstdlib>

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement