Re: Stopping command window from closing

From: Chris Schumacher (kensu___at_hotmail.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 04:11:05 GMT


"Gareth" <hotmail.com@dgareth.spm> wrote in
news:421e5890$0$23945$ed2e19e4@ptn-nntp-reader04.plus.net:

> I'm trying to learn c++ with Borland C++ Builder 6.
>
> It seems to be a fairly straightforward program to use using the
> "console wizard" for basic c++ textbook lessons
> (File>>New>>Other>>Console Wizard).
>
> But why do I need to insert the following line of code in to the
> source to prevent the XP command window from closing?:
>
> std::cin.get();
>
> Why doesn't the window automatically remain open and wait for a
> closure click to close?
>
> Gareth.

You need it to pause before the window closes. C++ is meant to be run
from a command prompt.
For windows the line is: system("pause");
I don't know what it'd be on a Unix system.

obAnsi: this solution is not ANSI compliant.

                                                            -==Kensu==-



Relevant Pages

  • Re: Krunch time here again
    ... Gareth wrote: ... I knew what it was and grabbed my camera and phone. ... I looked out of the window and saw a vehicle upside down, ... Heard melodies are sweet, ...
    (uk.people.silversurfers)
  • Re: Krunch time here again
    ... Gareth wrote: ... almighty ... ... I knew what it was and grabbed my camera and phone. ... I looked out of the window and saw a vehicle upside down, ...
    (uk.people.silversurfers)
  • Re: Krunch time here again
    ... Gareth wrote: ... I knew what it was and grabbed my camera and phone. ... I looked out of the window and saw a vehicle upside down, ... There's road signs saying SLOW and it's painted in the road too. ...
    (uk.people.silversurfers)
  • Re: My snowy pics
    ... Nice pictures. ... So glad you didn't fall out of the window ... Gareth (email address invalid) ..... ...
    (uk.people.silversurfers)
  • Re: Add context menu item for background of open folder window?
    ... I personally think they should have called it 'open command window ... window's path and THERE would be navigated to the folder being ...
    (microsoft.public.scripting.vbscript)