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: Per W. <pw...@ia...> - 2007-11-05 09:20:13
|
We are not talking about cross-platform. We are talking about the ability
to test a new application. Whatever works is good enough.
Portability is only meaningful if you write a special module to link into
the application that will autodetect if the program is run from the
command-line or started from a graphical environment.
/pwm
On Sun, 4 Nov 2007, Chris Miller wrote:
> 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 :)
>
|