Okay, I have just started to attempt learning C++ so please be patient with me, I am trying to explain this the best I can.
Okay, I have having problems with a code found in the tutorial. Anyway, when i am done copying and pasting the code from the site to my C++ Complier, i hit compile and run. Then the console will open and it will say "Please enter a number". I enter a number and hit the enter key, but this is my problem. Every time I hit the enter key my console closes on me for no apparent reason. Can anyone tell me how to stop my console from closing when I hit the enter key? Thanks.
Here is the code I am working with:
Code:
#include <iostream.h>
int main()
{
int thisisanumber;
cout<<"Please enter a number:";
cin>>thisisanumber;
cout<<"You entered: "<<thisisanumber;
return 0;
}