Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: typedef-ing an array Summary: corrections for two typos Message-ID: <25308@mimsy.umd.edu> Date: 5 Jul 90 16:04:49 GMT References: <78627@srcsip.UUCP> <78633@srcsip.UUCP> <25247@mimsy.umd.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 17 In article <25247@mimsy.umd.edu> I made two typing errors: >... typedef char foo[24]; ... [foo] has size 24*sizeof(char)==24 ... > printf("%d\n", sizeof(foo)); >must print 42. The last line above should read `24'. >[main] may have either 0 arguments or two (int argc, char *argv). The second argument should be `char **argv' (or equivalently `char *argv[]'; I recommend against the latter form since parameters declared as arrays are not arrays, but this is the only place in C when a declaration does not mean what it says, and this form leads programmers to believe that arrays and pointers are `the same', which is not the case). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris