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

Christopher R Volpe volpe at camelback.crd.ge.com
Sat Jun 29 00:25:54 AEST 1991


In article <m0jspJY-0001ieC at shiva.reed.edu>, minar at 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 at crd.ge.com



More information about the Comp.std.c mailing list