Re: [Dev-C++] How to not close output win?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Wing H. Y. <yok...@ve...> - 2003-10-04 08:14:50
|
Nathan Stanley wrote:
>
> From: "Wing H. Yi" <yok...@ve...>
> To: "Daniel Glenfield" <sp...@ho...>
> > int main()
> > {
> > functionToDoStuff();
> >
> > system("pause");
> > return 0;
> > }
>
> In cases where 'functionToDoStuff()' can exit the program, this is not
> acceptable, and is the case in the original email to list. This fix is good
> if your program can only exit at the end of main.
I suggested that alternative so that instead of explicitly exiting,
one could return from whereever in functionToDoStuff for the pause.
Though if there are many different functions that can exit, the use
of an exit function for the pause would be better.
However the 'atexit' suggested in another message sounds like
a cleaner solution.
|