Re: [Dev-C++] why does window close after execution? newbie
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Richard C. <tel...@ya...> - 2003-08-02 02:08:47
|
heck he's programming for DOS, let him use system("PAUSE").=20 it goes against the very nature of programming to get() or cin or scanf e= tc when you dont want to! i mean, sure it does the trick, but it doesnt 'wait for an 'enter'' it wa= its 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 lik= e they do in windows?? 1/08/03 9:31:46 PM, OROSZI Bal=E1zs <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=20 >> tutorial. >> When it is compiled and run it instantly closes the window after=20 >> 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 t= o=20 >> put up with adding some sort of pause statement at the end of everythi= ng=20 >> I write? >> =20 >> 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,=20 >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=E1zs > > > >------------------------------------------------------- >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 > |