Im working in C ++ and I have #define VAL 0x00000400 . when I set a variable equal to the definition: int value = VAL; when I run the debugger, the value of the variable = 1024 is displayed. Can someone explain how this turns into 1024? Perhaps some links to memory address information, #define info, or something important.
#define VAL 0x00000400
0x00000400 is base 16 for 1024. Your debugger shows you the integer value in base 10.
The "0x400" hexadecimal or base 16. 0x400, expressed as a decimal (base 10), is 1024.
By the way, you can use Google to create basic conversions. Search for "0x400 in decimal format," and Google will answer you.
0x00000400 is 400 base 16, which is 1024 base 10.
1024 in decimal = 400 in hexadecimal.
0x400 is a hexadecimal number (indicated by the prefix 0x ). This is another way to represent the decimal number 1024 .
0x400
0x
1024
In addition, the conversion from 0x400 (base 16) to base 10:
4*16^2 + 0*16^1 + 0*16^0 4*16^2 + 0 + 0 4*256 1024
well, I have not seen your code yet, but 400h = 1024 decimal and you specify the integer compiler 'int value = VAL', it just does not display any notifications / warnings, it does this for you