What's wrong with printf() , exit() ? (oops)

Larry Cipriani lvc at danews.UUCP
Mon May 12 03:49:33 AEST 1986


I wrote:
>> What's wrong with
>> 	printf("usage: foo bar\n"), exit(1);
>> as above?
>> 

>Aside from style, exit is a statement syntatically but , requires
>expressions.  The compilers I've used will accept this and do
>what you'd expect.  Why is that ?  Is this a special exeption ?

Oops.  I mistakenly believed exit and return were both reserved words
in C but only return is.  There may be compilers that won't accept it
but they would be wrong.

	printf("usage: foo bar\n") , return 1 ;

seems reasonably "within C's style".  Comments ?
-- 

Larry Cipriani		Nothing is worse than having
danews!lvc		an itch you can never scratch



More information about the Comp.lang.c mailing list