Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!topaz!harvard!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: malloc() Message-ID: <1677@umcp-cs.UUCP> Date: Sat, 24-May-86 00:11:17 EDT Article-I.D.: umcp-cs.1677 Posted: Sat May 24 00:11:17 1986 Date-Received: Sun, 25-May-86 18:09:59 EDT References: <3674@sun.uucp> <835@bentley.UUCP> <8@watmath.UUCP> Organization: Computer Sci. Dept, U of Maryland, College Park, MD Lines: 28 Summary: why have `void *' The real reason for `void *', which everyone seems to be missing, is that it provides a generic pointer type. Of course, if you need such a thing, you can usually get away with union all_possible_ptrs { char *ifchar; unsigned char *ifuchar; short *ifshort; unsigned short *ifushort; int *ifint; unsigned int *ifunit; long *iflong; unsigned long *ifulong; float *iffloat; double *ifdouble; }; but it is conceivable that this might be insufficent on a machine with special structure pointers. On such a machine, this union might be (say) 30 bits wide, whereas a generic pointer might be 34 bits. Thus `void *'. Besides, do you really *want* to use such a union? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu