Path: utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: typedef-ing an array Message-ID: <17016@haddock.ima.isc.com> Date: 3 Jul 90 19:01:53 GMT References: <78627@srcsip.UUCP> <78633@srcsip.UUCP> <25247@mimsy.umd.edu> <12433@sun.udel.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 20 In article <12433@sun.udel.edu> toor@sun.udel.edu (Kartik S Subbarao) writes: >In article <25247@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >>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. >[Sample code elided] No, Chris was right (except that he forgot the second star in `char **argv'). Many compilers accept buggy code and even produce the intended answer, but that doesn't make it right. Not even if most compilers do it. >So you CAN have a) void main if you desire, > b) only one argument to main. In the most common implementation, both of these happen to work. Neither is Standard-conforming. Both are likely to be caught by some future compiler. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint