typedef-ing an array

Kartik S Subbarao toor at sun.udel.edu
Tue Jul 3 11:55:27 AEST 1990


In article <25247 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>In article <78633 at srcsip.UUCP> pclark at SRC.Honeywell.COM (Peter Clark) writes:

>>void
>>  main()
>>{
>>  bar = "Silly old me";
>>  printf("%s\n",bar);
>>}
>
>>The initializer works fine, but the assignment inside main() doesn't.
>
>The first error is `void main': it must (yes must) be `int main', even
>if it never returns.  It may have either 0 arguments or two (int argc,
>char *argv).

(yes must)??!?!?!?!?! I beg to differ.

# include <stdio.h>

void main(int dumdum)
{
    printf("%d\n", dumdum);
    puts("Foobar");
}

works fine with gcc, and


# include <stdio.h>

void main(dumdum)
int dumdum;
{
    printf("%d\n", dumdum);
    puts("Foobar");
}

works fine with plain 'ol cc.

So you CAN have a) void main if you desire,
		b) only one argument to main.

-- 
toor at sun.acs.udel.edu -- (my summer address)



More information about the Comp.lang.c mailing list