[OCLUG-devel] exit vs. return

James Colannino james at colannino.org
Fri May 20 22:07:52 PDT 2005


I have one simple question (hope it's not a stupid one): why is it that
some people use exit() at the end of main() and others use return()?  I
know that return() simply returns from a function, and exit(), according
to the man page, exits from the shell (although I admit I don't quite
know what to make of this in the context of programming), but I'm not
clear as to why I've seen exit() used in some examples and return() in
others.  Thanks :)

James

-- 
My blog: http://www.crazydrclaw.com/
My homepage: http://james.colannino.org/

"A well regulated militia being necessary to the security of a free
state, THE RIGHT of the people to keep and bear arms SHALL NOT BE
INFRINGED." --United States Constitution, Second Ammendment



More information about the OCLUG-devel mailing list