🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3235

Re: so how do I do it? (was Re: call to revolt)

#3235
From: Christopher R Volpe
Date: Fri, 28 Jun 1991 14:25
24 lines
1146 bytes
In article <m0jspJY-0001ieC@shiva.reed.edu>, minar@reed.edu writes:
|>If
|>
|>void * p;
|>(int *)p++;
|>
|>is illegal, how do I do what I mean?

When you say "(int *)p++;", what you're really saying is:
  (int *)p = (int *)p + 1;

The only problem with that is that the left hand side is not an lvalue, because
of the cast. So, nuke the cast:
  p = (int *)p + 1;

There, the RHS is the expression you want, which can legally be assigned
to p, since it is an lvalue of type (void *).

-Chris
                                                  
==================
Chris Volpe
G.E. Corporate R&D
volpecr@crd.ge.com
Technical Details
Message-ID: <20997@crdgw1.crd.ge.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!camelback!volpe
References: <rabson.677868220@physics.ubc.ca> <m0jspJY-0001ieC@shiva.reed.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!camelback!volpe
From: volpe@camelback.crd.ge.com (Christopher R Volpe)
Newsgroups: comp.std.c
Subject: Re: so how do I do it? (was Re: call to revolt)
Message-ID: <20997@crdgw1.crd.ge.com>
Date: 28 Jun 91 14:25:54 GMT
References: <rabson.677868220@physics.ubc.ca> <m0jspJY-0001ieC@shiva.reed.edu>
Sender: news@crdgw1.crd.ge.com
Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe)
Lines: 24