Help with this please

I am sure this is boring for those of you who kow what you are doing, but i am completely new to all of this and need a bit of guidance. Please be gentle.

I do not understand when the score asked for is input the screen disappears. I thought cin.get solved this problem. Here is the very basic code.


#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain()
{
cout << " Hey how are you? ";
cout << "\n"; cout << "\n";
cout << " This is a little program i have just written. ";
cout << "\n"; cout << "\n";
cout << " can you rate it from 0 to 10 please? ";
cout << "\n"; cout << "\n";
cout << " Please enter your score. ";
int x;
cin >> x;
cout << "\n"; cout << "\n";
cout << " The score you gave was... " << x << endl;
cout << "\n"; cout << "\n";

cin.get();
return 0;
}
Thanks for your help in advance.
Thank you for refering me to that post, but forgive me for sounding stupid, i thought that

cin.get ()

was put in to solve the problem i am having.

No worries, thanks for your help.

The problem was easily solved by adding

cin.ignore () at the end.
Last edited on
Topic archived. No new replies allowed.