how can i open the window open

Discussion in 'C++' started by wax, Dec 18, 2006.

  1. wax

    wax Guest

    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
     
    wax, Dec 18, 2006
    #1
    1. Advertising

  2. wax

    VistaUser Guest

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


    Give up. You aren't clever enough to use a computer.
     
    VistaUser, Dec 18, 2006
    #2
    1. Advertising

  3. wax

    VistaUser Guest

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


    Give up. You aren't clever enough to use a computer.
     
    VistaUser, Dec 18, 2006
    #3
  4. wax

    Default User Guest

    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
     
    Default User, Dec 18, 2006
    #4
  5. 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.
     
    Jacek Dziedzic, Dec 19, 2006
    #5
  6. wax

    White Wolf Guest

    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.
     
    White Wolf, Dec 19, 2006
    #6
  7. wax

    Salt_Peter Guest

    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::streamsize>::max(), '\n');
    return 0;
    }
     
    Salt_Peter, Dec 19, 2006
    #7
  8. wax

    Salt_Peter Guest

    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?
     
    Salt_Peter, Dec 19, 2006
    #8
  9. wax

    zouyongbin Guest

    "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.
     
    zouyongbin, Dec 19, 2006
    #9
  10. wax

    Guest

    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...f543c/97606533d1a77164?hl=en#97606533d1a77164
     
    , Dec 19, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Clare Hsiao
    Replies:
    11
    Views:
    268
    Michael Winter
    Feb 13, 2004
  2. PC HUA
    Replies:
    2
    Views:
    438
    PC HUA
    May 19, 2004
  3. Matt
    Replies:
    1
    Views:
    478
    Michael Winter
    Aug 22, 2004
  4. Replies:
    3
    Views:
    197
  5. sowen
    Replies:
    2
    Views:
    175
    Thomas 'PointedEars' Lahn
    Aug 8, 2007
Loading...

Share This Page