I wanted to read a value which is stored at an address whose absolute value is known. I am wondering how could I achieve this. For example. If a value is stored at 0xff73000. Then is it possible to fetch the value stored here through the C code. Thanks in advance
Two ways:
1. Cast the address literal as a pointer:
char value = *(char*)0xff73000;
2. Assign the address to a pointer:
char* pointer = (char*)0xff73000;
Then access the value:
char value = *pointer;
char fist_byte = pointer[0];
char second_byte = pointer[1];
Where char
is the type your address represents.