Path: utzoo!attcan!uunet!oddjob!ncar!ames!nrl-cmf!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: is there anything wrong with return(n) from main? Message-ID: <8203@brl-smoke.ARPA> Date: 1 Jul 88 18:50:14 GMT References: <741@vsi.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: comp Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <741@vsi.UUCP> friedl@vsi.UUCP (Stephen J. Friedl) writes: >doing a return(n) from main: I used exit(n) instead. "return n" is technically correct, and is slightly more satisfactory from a "top-down control" viewpoint. I have heard that there are some purported C implementations that ignore the return value from main(), though, always returning a success indicator unless exit() is used. Those aren't Standard-conforming implementations, but you might be stuck with one. P.S. You don't need parentheses around the return expression.