Xref: utzoo comp.lang.c++:10996 comp.lang.c:35043 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: char* vs void* Keywords: char* vs void* pointer arithmitic Message-ID: <27848233.5F8B@tct.uucp> Date: 4 Jan 91 13:25:07 GMT References: <17590@paperboy.OSF.ORG> <277BAC53.F2A@tct.uucp> <1991Jan2.171429.11566@glinj.gli.com> Organization: Teltronics/TCT, Sarasota, FL Lines: 17 According to bobj@glinj.gli.com (Robert Jacobs): >What I can't understand is that ANSI decided that one cannot do pointer >arithmitic on a void*, like a char*. Because of this, new work is forced >to use char* as the generic pointer that can do pointer arithmitic. >This continues the existing practice that char* is special. Perhaps ANSI figured that since |char *| already serves as the generic pointer that supports pointer arithmetic, making |void *| do the same would render |void *| redundant and therefore useless. As the language stands now, your choice of |char *| or |void *| communicates to the compiler and to human readers your intentions as to pointer arithmetic (|char *| if yes, |void *| if no). -- Chip Salzenberg at Teltronics/TCT , "Please don't send me any more of yer scandalous email, Mr. Salzenberg..." -- Bruce Becker