Operations on pointers to void.

Stan Brown, Oak Road Systems browns at astro.pc.ab.com
Sun Aug 12 03:48:36 AEST 1990


In article <1990Aug9.231614.5196 at basho.uucp>, john at basho.uucp (John Lacey) writes:
> What operations are legal on pointers to void?

It may help you to think of them as "void pointers" rather than "pointers to
void".  "Pointer to void" sounds too much like "pointer to int" and makes me (at
least) think of a real pointer to a real object of unspecified type.  In fact a
void pointer is just storage in memory where you may later put a pointer to any
type of data.  Only then does the value of the pointer become meaningful.  And
even then, if you're going to do much beyond simple assignments you haave to
use casts.

Do you have a particular use of void* in mind, or is this a general-info
question?

>                                                 K&R2 is it's usual self
> on the matter---no one can tell if what they say is possible, required, 
> complete, a couple of examples, or what.

Hey--don't insult my religion!  :-)

Stan Brown, Oak Road Systems, (216) 371-0043
The opinions expressed are mine. Mine alone!  Nobody else is responsible for
them or even endorses them--except my cat Dexter, and he signed the power of
attorney only under my threat to cut off his Cat Chow!



More information about the Comp.lang.c mailing list