Hi,
i have a Hex string which i would like to convert into decimal (non MFC).
char m_cBodyAddress[9] = "80100000";
void* pAddVoid = (void *)&m_cBodyAddress[0];
unsigned char* pAddChar = (unsigned char *)pAddVoid;
unsigned long* pAddLong = (unsigned long *)pAddVoid;
Now, the pointers all point to the same memory (0x0012f8d1). But the values of the long dont match what i have calculated the hex to be.
pAddChar = "80100000" - correct - hex string
pAddLong = 808529976 - incorrect - long version of hex string
The correct output according to my hex calculator should be:
2148532224 (0x80100000)
Can anyone help me out?
Thanks.
i have a Hex string which i would like to convert into decimal (non MFC).
char m_cBodyAddress[9] = "80100000";
void* pAddVoid = (void *)&m_cBodyAddress[0];
unsigned char* pAddChar = (unsigned char *)pAddVoid;
unsigned long* pAddLong = (unsigned long *)pAddVoid;
Now, the pointers all point to the same memory (0x0012f8d1). But the values of the long dont match what i have calculated the hex to be.
pAddChar = "80100000" - correct - hex string
pAddLong = 808529976 - incorrect - long version of hex string
The correct output according to my hex calculator should be:
2148532224 (0x80100000)
Can anyone help me out?
Thanks.