Re: [Dev-C++] Dev-C++] won't let me see the results
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Chris M. <lor...@gm...> - 2007-11-05 03:10:18
|
Per Westermark wrote: > Dev-C++ is behaving the standard Windows way, i.e. console applications > started from a graphical program closes as soon as the application ends. > > Just add a system("pause") command at the end of main(), or add a command > to read from stdin. > As a matter of practise, it's better to include either iostream or stdio and to either cin; or to scanf();, since that's more cross-platform. system("pause") only works on Windows platforms, which is a really bad thing IMHO. I often write code that needs to work on UNIX and Win32 platforms, so it's best to learn to write the right way, as opposed to having to run through and change a bunch of code later. If someone knows a more elegant way still, I'm totally open to that. Including either of those console libraries adds a significant size to the resultant binary, so if there's something else I'm not aware of, I'd love to hear it :) |