Hello,
I am trying to write to a specific memory location in C, but I keep getting a segmentation fault.
All the addresses returned are in 7digit hexadecimal, and the address used in the below program (85a9008) was got printing the address from a previous program, which means that writing to this memory location is permitted.
Code:
#include <stdio.h>
int main(void)
{
char* address = (int *)0x85a9008;
*address = 'a';
printf("\n*address == [%c]",*address);
printf("Memory address is: 0x%p\n", address);
return 0;
}
Please advise.
Thanks.
Bookmarks