I am trying to compile my first c++ file on windows with the g++ compiler...
My cpp file is the following -
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
I type in this on command prompt to get to the directory
cd C:\Users\Mark
Then to compile my program I do
g++ hello.cpp
It creates a file name a.exe (default) but when I click on it the command prompt quickly flashes open then it's gone.
What did I do wrong? It should say Hello World! on the prompt and stay there, right?