By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,124 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,124 IT Pros & Developers. It's quick & easy.

how can i open the window open

P: n/a
wax
Hello.

// 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;
}

i enter the integer but whan i press enter the programe runs and i can't see
the results.
how can i open the window open?

Thanks
Dec 18 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
wax wrote:
how can i open the window open?
Give up. You aren't clever enough to use a computer.

Dec 18 '06 #2

P: n/a
wax wrote:
how can i open the window open?
Give up. You aren't clever enough to use a computer.

Dec 18 '06 #3

P: n/a
VistaUser wrote:
wax wrote:
how can i open the window open?

Give up. You aren't clever enough to use a computer.

Says the guy who double-posted his message.

*plonk*

Brian
Dec 18 '06 #4

P: n/a
wax wrote:
Hello.

// 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;
}

i enter the integer but whan i press enter the programe runs and i can't see
the results.
how can i open the window open?
try adding

int dummy;
cin >dummy;

before the return. This will wait for a number and an enter.

or add

for(;;) {}

which will result in an infinite loop.

HTH,
- J.
Dec 19 '06 #5

P: n/a
Jacek Dziedzic wrote:
SNIP]
try adding

int dummy;
cin >dummy;

before the return. This will wait for a number and an enter.

or add

for(;;) {}

which will result in an infinite loop.
std::cin.get(); ?

--
WW aka Attila
:::
It is easy to be flexible when one is spineless.
Dec 19 '06 #6

P: n/a

wax wrote:
Hello.

// 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;
}

i enter the integer but whan i press enter the programe runs and i can't see
the results.
how can i open the window open?
You mean, how can you keep the window open. Typically, by running the
program in the environment it is written for. However, here is a
portable way to pause in the case you are executing a link (instead of
invoking the program from the console):

#include <iostream>
#include <ostream>
#include <limits>

int main(void)
{
// do stuff
std::cout << "Press Enter to Exit.";
std::cin.ignore(std::numeric_limits<std::streamsiz e>::max(), '\n');
return 0;
}

Dec 19 '06 #7

P: n/a

VistaUser wrote:
wax wrote:
how can i open the window open?

Give up. You aren't clever enough to use a computer.
Some people don't use English as a first (or even a second language).
Yet he managed to Post a relatively clear question without replicating
*his* Post. Who do you think is more clever?

Dec 19 '06 #8

P: n/a

"VistaUser д
"
wax wrote:
how can i open the window open?

Give up. You aren't clever enough to use a computer.
This is not the correct attitude toward a question.

Dec 19 '06 #9

P: n/a

Salt_Peter wrote:
VistaUser wrote:
wax wrote:
how can i open the window open?
Give up. You aren't clever enough to use a computer.

Some people don't use English as a first (or even a second language).
Yet he managed to Post a relatively clear question without replicating
*his* Post. Who do you think is more clever?
Like hell he did. He posted the exact same question a half hour before
that under a different subject thread.

http://groups.google.com/group/comp....606533d1a77164

Dec 19 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.