cin not working!

Hello all, I'm beginning with C++...

my problem is very simple, I have this program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// my first string
#include <iostream>
#include <string>
using namespace std;

int main ()
{
  int n;
  cout << "Enter the starting number > "; 
  cin >> n;
  cout << "FIRE!\n";
    cout << n;

  return 0;
}


and the cin is not working. When the program runs it shows me the line

Enter the starting number >

I enter the number, press enter, then nothing happens. It doesn't skip the instruction to the next one, but just stop and freeze...

Any idea? Thanks a lot!
Looks fine to me. How do you run? Do you double click the exe or type the exe name from a separately running console window? If you double click then the console is probably disappearing before you can see what happened.
Topic archived. No new replies allowed.