It's your binary conversion function that is not working correctly.
0x003FFE1C
is 00000000001111111111111000011100
You're not going far enough with the bits.
You might want to do a
sizeof (Ap)
to see how many bits you need. (Here 32)
You should change your loop index so that it is the bit position rather than the shifted value, otherwise you are risking overflow.
for (int ii = 31 ; ii >= 0 ; -- ii)
{
if (x & (1 << ii) != 0)
strcat (b, "1) ;
else
strcat (b, "0") ;
}