i have wrote my "Hello World" code but now want it to stall afta being decoded so that command prompt exit when you press a key. i have used the following to try and do it but it doesnt seem to be working:
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World";
cout<<"Press any key to destroy the World mwhahaha!";
system ("PAUSE");//this line doesnt seem to work
return 0;
}
i have inputted that instead of system ("PA...... and it still brings up an error message. it says; unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I think that was the reason it wasnt working but i just copied and pasted a code from the variables tutorials into VC++ and it doesnt let that run. it says the same error message again:S
See, here's the problem with VC++: The default project configuration sucks balls. You can either create a new empty project or do this:
Go to project properties (right click on the project, at the bottom), C/C++>Precompiled Headers>Create/Use Precompiled Header>Not Using Precompiled Header.
Now remove everything from the project that isn't the main .cpp.