exit() vs. return June 07, 2010 01:57AM | Registered: 15 years ago Posts: 34 |
Re: exit() vs. return June 07, 2010 03:35PM | Registered: 16 years ago Posts: 74 |
Re: exit() vs. return June 07, 2010 04:37PM | Registered: 16 years ago Posts: 276 |
Re: exit() vs. return June 07, 2010 05:45PM | Registered: 15 years ago Posts: 379 |
Re: exit() vs. return June 08, 2010 01:36AM | Moderator Registered: 16 years ago Posts: 441 |
void __crtmain() { __init(); SYS_PreMain(); exit ( main(__system_argv->argc,__system_argv->argv) ); }
Re: exit() vs. return June 08, 2010 05:06PM | Registered: 16 years ago Posts: 73 |
If you declare a C++ object locally (e.g. on the stack), when you call exit(), that object never goes out of scope. This means that object is never destructed. I think that's a big deal if you're doing something important in your destructors. I use exit() only when something bad happens, and I can't easily get back to the closing brace inside my main. Otherwise, I return from main.Quote
So that means it doesn't really matter if you call exit() within your app, or just return from main.