<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi, I think there is no difference when you use exit(0) or return 0 in main(), but different when you try to use in sub function. Simply return will exit from current function, but exit will terminate the program, here is the link you can look at:&nbsp;<div><a href="http://stackoverflow.com/questions/17383015/difference-between-return-0-and-exit-0">http://stackoverflow.com/questions/17383015/difference-between-return-0-and-exit-0</a></div><div><br></div><div>Thanks,</div><div>JIANLONG ZHOU<br><div><div>On Sep 10, 2014, at 3:32 PM, Sadia Akhter &lt;<a href="mailto:sakhter@stevens.edu">sakhter@stevens.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>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?<br><br>Thanks,<br>Sadia Akhter<br>_______________________________________________<br>cs631apue mailing list<br><a href="mailto:cs631apue@lists.stevens.edu">cs631apue@lists.stevens.edu</a><br>https://lists.stevens.edu/mailman/listinfo/cs631apue<br></blockquote></div><br></div></body></html>