C++ quickness, please help :)
Hi, i'm Hussain Hani from Kuwait i'm 15 years old learning C++ from the book :
Beginning C++ game programming. And i'm having a problem that once i run the program it closes in second :( although i wrote the code that stops that. This is my full code :
Code:
//Working with variables
#include <iostream>
using namespace std;
int main()
{
int score = 7;
cout << "Score: " << score << endl;
score++;
cout << "Score: " << score << endl;
++score;
cout << "Score: " << score << endl;
cout << "Press enter to exit this program." << endl;
cin.ignore(cin.rdbuf()->in_avail()+1);
return 0;
}
I'm waiting :)