lvalue required as increment operand

Ian Lance Taylor iant@google.com
Wed Jun 19 06:14:00 GMT 2013


On Tue, Jun 18, 2013 at 11:01 PM, vijay nag <vijunag@gmail.com> wrote:
>
> Consider the following expression
>
> char *foo = &bar;
> ((unsigned long*)foo)++

I think the correct way to get the same effect these days is not what
you suggested, but rather something like
    foo = (char *) (((unsigned long*)foo) + 1);

Ian



More information about the Gcc-help mailing list