[cs631apue] exit() vs return in c programs

Sadia Akhter sakhter at stevens.edu
Wed Sep 10 15:32:55 EDT 2014


Hi,

In my previous experience with C, I have always used "return 0;" to return from main() function. Those were of course not any system programming codes. However, in the text book APUE, I noticed that they always use "exit(0)" in main(). Can anyone tell me why is that? Is there any significant difference between these two? Or is it just regular practice?

Thanks,
Sadia Akhter


More information about the cs631apue mailing list