want to know

Herman Rubin cik at l.cc.purdue.edu
Fri Aug 18 00:55:57 AEST 1989


In article <21309 at cup.portal.com>, Tim_CDC_Roberts at cup.portal.com writes:
> Regarding the 'Why is main called main()?' fiasco:
> 
> If this was a joke, then I was taken in, because I penned a four paragraph
> beginner-style response to this message.
> 
> There are pros and cons to the main_as_default_transfer_address scheme,
> of course.  If you allowed any label to be the transfer address, then you
> would need some kind of syntax to specify what to use:
> 
>       main (int argc, char ** argv) {  ....
> 
> could become
> 
>       transfer int entry_point (int argc, char ** argv) { ...

This is not adequate.  I have used systems where only one program card
was used, and it needed the explicit list of program arguments, but
one could still transfer to any other entry point.  Of course, this 
did not use argc and argv.

In C, one could start an arbitrary program with

int argc;
char** argv;
program(........)

to handle the problem.  If this does not work (I have not tried it), put the
handling of argc and argv in the loader.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin at l.cc.purdue.edu (Internet, bitnet, UUCP)



More information about the Comp.lang.c mailing list