Hi all,
I'm sure this is a n00b question, but I can't seem to get my head around it!
I have a 4 BYTE array which I want to display as a decimal value.
For example, in the array it contains the hex values: 00 05 7d a4, and I would like to display 359,844.
Any clues on how I go about this?
I have tried:
BYTE freeBlocks[4];
memcpy(freeBlocks, trackInformation + 16, 5);
_tprintf(_T("%u"), strtoul((char*) freeBlocks, NULL, 16));
But this only prints out 0. I know freeBlocks contains the correct values as when I do:
for(int i; i < 4; i++)
_tprintf(_T("%x "), freeBlocks[i]);
it displays as expected (00 05 7d a4)
Am I going about it in the right way?
Thanks,
Damien