In python, you can find out the memory location of variables using the id function, therefore:
X = "Hello world!" print(id(X))
I am trying to access a variable with pointers in C (of course, another program is still alive):
#include <stdio.h> int main(void){ char *x = (char *) 0x7F27483876F0; printf("%s\n", x); return 0; }
I am compiling the code, no errors or warnings, but when I tried to start the OS, giving a segmentation error. How can I solve this problem?
Or is it possible?
source share