Casting Question

VLD/VMB gwyn at BRL.ARPA
Sat Jan 18 00:57:41 AEST 1986


pc = *((Inst **)(savepc+2));
is not the same as
pc = (Inst *)(savepc+2);
In the former case, you are saying that savepc+2 points at an
(Inst *), which you retrieve and stuff into pc.  In the latter
case, you are setting pc to be equal to the pointer savepc+2.
Not at all the same thing.

Figuring out how this section of hoc works is great C practice.



More information about the Comp.lang.c mailing list