incrementing after a cast

Kenneth R. Ballou ballou at brahms
Sun Dec 7 12:35:55 AEST 1986


In article <1746 at batcomputer.tn.cornell.edu> braner at batcomputer.UUCP (braner) writes:

>If  ((sometype *)pointer)++ is not legal, then the law should be changed!

Why?

>(since the pointer-type cast is legal, why can't you use the resulting
>pointer like any pointer of sometype?)

You can use the *VALUE* of the pointer in exactly the same way as you could
use the *VALUE* of any other pointer.  Keep in mind that the pre/post-increment
operator requires one of those mythical beasts, an l-value.  Likewise, you
could not apply pre/post-increment to the result of a function call.



More information about the Comp.lang.c mailing list