+ 6
I m just a beginner
but I like return rather than exit
+ 5
I always let it fall back to the main function, the reason is because the compiler inserts its own code before and after calling main. When main returns, destructors and some cleaning up is done, then exit is eventually called with what you returned from main.
+ 2
Sometimes it's best to remember the simple things:
exit () is a system call
return is an instruction
system calls tend to be expensive. Just saying.
+ 2
i used exit sometimes but i prefer return.
+ 2
use 'exit' to terminate a loop and 'return' to obtain the final value of a function.. that's according to my opinion
+ 1
if you dont need to return but you want to exit from your program in some point what you should do?! or you need to return in your function you cant exit () you need to return. it depends where you use it. in the function or in the regular code and it depends on return type of your function.
+ 1
I never use exit. But when i do WoW. lol