Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!yale!mfci!karzes
From: karzes@mfci.UUCP (Tom Karzes)
Newsgroups: comp.lang.c
Subject: Re: pointer increment
Message-ID: <977@m3.mfci.UUCP>
Date: 16 Aug 89 19:12:22 GMT
References: <484@eagle.wesleyan.edu> <829@ruso.UUCP>
Sender: karzes@mfci.UUCP
Reply-To: karzes@mfci.UUCP (Tom Karzes)
Organization: Multiflow Computer Inc., Branford Ct. 06405
Lines: 12

In article <829@ruso.UUCP> wolfgang@ruso.UUCP (Wolfgang Deifel) writes:
>dkonerding@eagle.wesleyan.edu writes:
>If you want to increment ptr only by one you should use a cast.
>
>    ((char*)ptr)++ ;

This is not legal C, since a cast expression is not a valid LHS.  You can
no more use this than you can use:

    ((char *) ptr) = ...;

Some compilers may accept this, but it isn't legal C.