Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Operations on pointers to void. Message-ID: <1990Aug13.172104.16172@zoo.toronto.edu> Organization: U of Toronto Zoology References: <1990Aug9.231614.5196@basho.uucp> <1990Aug10.165644.9238@zoo.toronto.edu> <482@array.UUCP> <1990Aug12.231202.23826@druid.uucp> Date: Mon, 13 Aug 90 17:21:04 GMT In article <1990Aug12.231202.23826@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: >I'll buy the argument about -pedantic but in general I think it is useful >to be able to manipulate generic data. Things like memcpy for example. We >know that the data can be any type but we want to treat it as bytes. Perhaps >we need a new type which acts like void * but allows pointer arithmetic based >on the smallest data type supported by the system... It's called `char *'. :-) The various tricky implementations in which it would not be a valid "generic pointer" have pretty well all been outlawed by various rules in ANSI C. Note that `void *' and `char *' are constrained to have the same representation. -- 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