Cannot keep the "output" open :(

I can't keep it open! When I run the file, a black screen just flashes and go away! I wanted to test out this:

1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;

int main ()
{
  cout << "I hope this works!"; 
  return 0;
}
It seems to work when I used your code there.
I would add

1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;

int main ()
{
  cout << "I hope this works!" << endl; 
  return 0;
}

just to make it look better hehe the endl just moves the "Press any key to continue" down one line.
Last edited on
Topic archived. No new replies allowed.