Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c Subject: Re: Casting pointers Keywords: cast Message-ID: <11072@alice.UUCP> Date: 20 Jul 90 13:58:11 GMT References: <1614@ghost.stsci.edu> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 12 In article <1614@ghost.stsci.edu>, davids@stsci.EDU (David Silberberg) writes: > Does anyone know if the following cast operation will perform correctly? > (char *)ptr += num_chars; This is not legal C -- the result of a cast is not an lvalue -- so the `correct' thing to do is to issue a diagnostic message during compilation. Some implementations do this, others don't. -- --Andrew Koenig ark@europa.att.com