Here is the thing, 1024 = 0x400, and I assume its binary representation (little endian) is \\x00\\x4\\x00\\x00. And I try to do something like this,
int main()
{
const char *str = "\\x00\\x4\\x00\\x00";
const int *p = (const int *)str;
printf("%d\n", *p);
}
But why the above code can’t give me 1024?
Because you escaped
\. Unescape them: