I have programed before but it's been over 2 years so I tried thing I could remember but nothing is working for me. I started over with hello world but again it won't work. here's my code
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!!" << endl;
system("PAUSE");
return 0;
}
and here are the errors
Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib this one
Error 2 fatal error LNK1120: 1 unresolved externals u:\Visual Studio 2008\Projects\this one\Debug\this one.exe 1 this one
1. Don't use system(). I'll eat your liver if you do.
2. Right click your project. Go to Properties -> Linker -> System -> SubSystem -> Console (/SUBSYSTEM:CONSOLE)
fire child,
Some People Dont like system(), and they have Great reasons too, which you will learn
in the future, but for now you will be fine. And if you dont want to use system() anymore,
try using getch();
That's not the point. If you are interested in learning how to program you must learn about portability. Executing OS commands using system() is completely non-portable (e.g., your use of system will not work on unix). It's also inefficient since it starts another process to run the command. You should replace it with cin.get();, which will work fine as long as you haven't left any newlines in the input (and cin is in a good state).