Suppose some memory location 0xF0000 contains four character string "four" .
so is this valid:
char *mem = (char*) 0xF0000;
and then is mem[0] == ‘f’ ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure it is. If the memory is mapped with the correct permissions (write) it should make no difference whatsoever to the operating system.
An easy way to test this is using
gdb. You can break and change the value ofmeman make it point to some memory, right before an instruction tries to change it.In particular, don’t try to modify a string literal (
char *readonly = "mystr");