Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: Operations on pointers to void. Message-ID: <397@taumet.com> Date: 10 Aug 90 15:37:16 GMT References: <1990Aug9.231614.5196@basho.uucp> Organization: Taumetric Corporation, San Diego Lines: 19 john@basho.uucp (John Lacey) writes: >What operations are legal on pointers to void? ... You may cast to or from type void*. You may assign, initialize, or pass as a parameter any pointer to an object of type void*, and vice versa. You may not dereference an object of type void*. >But, what about pointer arithmetic? And it that is legal, what size object >does a void * point to? You cannot do pointer arithmetic with an object of void*. No object may have type void, so no size can be associated with it. It is helpful to think of void as "not anything", rather than "zero". Void* is a special case, and you can think of it as "pointing to something unspecified". -- Steve Clamage, TauMetric Corp, steve@taumet.com