increment casted void pointer -- ANSI?

Stephen R. van den Berg berg at marvin.e17.physik.tu-muenchen.de
Wed Mar 13 23:56:07 AEST 1991


Stanley Friesen writes:
>To pretend a variable has a different type utter the following magic
>incantations:

>b = *++ *(char **)&p;

Nice.  Could be usefull to know this (some time).  But, in my original
application (not the example I showed, it was a library replacement of
memmove) I use register void pointers, to which the above trick cannot
be applied (sigh).
--
Sincerely,                 berg at marvin.e17.physik.tu-muenchen.de
           Stephen R. van den Berg.
"I code it in 5 min, optimize it in 90 min, because it's so well optimized:
it runs in only 5 min.  Actually, most of the time I optimize programs."



More information about the Comp.lang.c mailing list