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