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;

cout << "The value you entered is " << i;

cout << " and its double is " << i*2 << ".\n";

return 0;
Does it say anywhere in your program to keep the console window open after entering an integer?
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.

Read this, which is stickied to the beginners page, and read the articles in the reference section, top left of this page.

Topic archived. No new replies allowed.