Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!srhqla!demott!kdq From: kdq@demott.com (Kevin D. Quitt) Newsgroups: comp.lang.c++ Subject: Pointer arithmetic Keywords: char* vs void* pointer arithmitic Message-ID: <1991Jan4.191051.3995@demott.com> Date: 4 Jan 91 19:10:51 GMT Reply-To: kdq@demott.COM (Kevin D. Quitt) Organization: DeMott Electronics Co., Van Nuys CA Lines: 14 What about the subtraction of pointers to get a constant? I discovered that gcc does not allow: int = strchr( string, char ) - &string; to determine the position of char within string. Is there a (good) reason for disallowing this? BTW, Microsoft C *does* accept this. -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last