Okay, this is certainly a different problem to the one you described at the beginning of this thread.
The problem now is that the code you are compiling does not comply to the current C++ standard.
If you really need this code to compile, you can start with the following simple things:
1) Get rid of "prog1.cpp:6: error: `main' must return `int'". This usually is because your main function is declared like:Change the beginning and end to be like:
Code:
int main(){
...
return 0;
}
2) Get rid of the warning about deprecated includes. At line 3 of your program, you have:
Code:
#include <iostream.h>
This should probably be:
Code:
#include <iostream>
using namespace std;
What is this code? If you are teaching yourself C++ from a book, I'm afraid your book is out of date.
Bookmarks