Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Operations on pointers to void. Message-ID: <1990Aug10.165644.9238@zoo.toronto.edu> Organization: U of Toronto Zoology References: <1990Aug9.231614.5196@basho.uucp> Date: Fri, 10 Aug 90 16:56:44 GMT In article <1990Aug9.231614.5196@basho.uucp> john@basho.uucp (John Lacey) writes: >... dereferencing and subscripting are illegal. >But, what about pointer arithmetic? ... Subscripting *is* pointer arithmetic. Apart from passing them around and comparing them to each other and to NULL, there is *nothing* you can do with `void *'s except convert them to another kind of pointer. No dereferencing, no arithmetic. They are containers for other kinds of pointers, not pointers themselves. Many compilers, especially old ones with `void *' hastily kludged in, treat `void *' much like `char *'. That is a compiler bug. -- It is not possible to both understand | Henry Spencer at U of Toronto Zoology and appreciate Intel CPUs. -D.Wolfskill| henry@zoo.toronto.edu utzoo!henry