entry at other than main (was: want to know)

Alan J Rosenthal flaps at dgp.toronto.edu
Mon Sep 4 13:30:34 AEST 1989


bbadger at x102c.harris-atd.com (Badger BA 64810) writes:
>I just wonder whether it [main() being the entry point] deserves a secure
>place in the standard, because I can't see that the language would be any
>worse off without it.

Without it, you cannot write Hello, world portably!
"int main() { printf("Hello, world\n"); return(0); }" ??
No, it might not get run.

Remember that the purpose of the standard is to allow the writing of portable
programs.  That means that someone else can recompile your program somewhere
else without editing it and it will work and do the same thing it did for you.
The standard is not merely a guideline as to what is a good C implementation.

ajr



More information about the Comp.lang.c mailing list