This example didn't work for me in the sites tutorial. When I debugged it, it would say:
Please enter an integer value:
I would enter an integer, press return and the console window would not show the other cout line or it wouldn't pause for it. It would go right back to the program. How do you get the second cout line to pause, so that you can see the the text and the number doubled?
// i/o example
#include <iostream>
using namespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
What progrady said, there plenty of ways to keep the window open.
You could make it loop till you tell it to stop, or you could wait for another input which would be the same as pause, since the program will wait for the input before carrying on.
I'll do a little searching for a good pause line. I haven't got that far ye in the tutorial. I just thought the tutorial example would have a pause line in it, because it hadn't gone over pause commands. However, I'll have to research it some more, and keep on with the tutorial. Thanks for your replies.