Re: [Dev-C++] why does window close after execution? newbie
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Graham <sai...@bi...> - 2003-08-02 02:49:37
|
The debate about which piece of code to use to stop the window from closing
is very interesting and educational and I thank all contributors
BUT
My question is can it be done without adding code.
The problem only occurs when I compile and run in DEV-C
When I take the work in to uni, they run it on grasp or something else where
this problem doesnt occur.
SO
My Question Is
is the not a setting in DEV-C that will make it keep the window open??
eg this is a DEV-C question not a C programming question
thanking all for your assistance
Graham
----- Original Message -----
From: "Richard Chiu" <tel...@ya...>
To: <dev...@li...>
Sent: Saturday, August 02, 2003 11:45 AM
Subject: Re: [Dev-C++] why does window close after execution? newbie
heck he's programming for DOS, let him use system("PAUSE").
it goes against the very nature of programming to get() or cin or scanf etc
when you dont want to!
i mean, sure it does the trick, but it doesnt 'wait for an 'enter'' it waits
to read in the next character or string or whatever.
i dunno, i'm being pedantic i know. ;)
but how many other platform have console windows which open and close like
they do in windows??
1/08/03 9:31:46 PM, OROSZI Balázs <or...@vp...> wrote:
>Graham wrote:
>
>> I have installed Dev-C under Win XP Pro
>> and am running the traditional "Hello World" as the first exercise in my
>> tutorial.
>> When it is compiled and run it instantly closes the window after
>> printing to the screen. I therefore cant see the output.
>> Is there a way to change this with a setting of DEV-C or will I have to
>> put up with adding some sort of pause statement at the end of everything
>> I write?
>>
>> my code looks like this
>> /*
>> *Hello, "Hello World.\n"
>> */
>> #include <iostream>
>> int main ()
>> {
>> cout<<"Hello, world.\n";
>> return 0;
>> }
>
>This is indeed a VVVVVFAQ (very-very-very-very-...).
>BTW this is absolutely NORMAL behaviour. To make the dos-prompt stay,
>you need to pause your program at the end. Use this line before return:
>
>getc();
>
>This will wait for an "Enter".
>(I don't like system("PAUSE"), as that is platform-dependent).
>
>--
>Greetings,
> Balázs
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|