Pointer and integer addition

Duane Richard LaMont lamont at uts.amdahl.com
Sat Mar 30 13:15:58 AEST 1991


In article <8334 at umd5.umd.edu> dzoey at terminus.umd.edu (Joe Herman) writes:
>Next, I tried
>
>fooptr = (char *) fooptr + fooptr->recsize;
>
>No difference, so I guess it gets the value to multiply the increment from
>the lvalue.

You were definitely on the right track, try:

    (char *) fooptr += fooptr->recsize;


Rick LaMont



More information about the Comp.lang.c mailing list