Hello there,
I have a question regarding pointers conversions (not sure if i got that right in English). Lets say I am on a 32 bit system, little endian.
There is an 8 bit variable:
This variable exists somewhere in the memory space.Code:uint8_t var8 = 0x12;
Now I create a 64 bit type pointer without memory allocation:
And assign my 8 bit var address to it:Code:uint64_t* ptr64 = 0;
When I will look at the LSB of value under ptr64 it will be 0x12. But what will be under other 56 bits? For my tests, it gave 0's, but I feel i was lucky. By doing this conversion, am i playing with segmentation fault, as I am overlaping some memory next to my pointer?Code:ptr64 = (uint64_t*)&var8;
I would apreciate all help!