I would like to write an address in a text file, which can be read by fscanf and dereferenced by C after reading the pointer. How do I write the address in the file?
edit:
i don’t mean to be rude, but i know that this is exactly what i need, so if anyone can please just list the answer, and not ethical reasons for why i shouldn’t be doing this, that would be great!
further edit:
ah, i was misclear about what I want to do. In emacs, I want to (with my fingers!!) write in an address that a C program could read in using fscanf and use as a pointer. How do I physically (with my fingers!!) write an address in emacs. For example, if I wanted C to read in 0x11111111, I am trying to write 0x11111111 in emacs, but it’s not becoming the right address in C when i read it in.
I don’t see the problem, here is the snippet using a string instead of a file:
the pointers are identical.
BTW, if you write “0x12345678”, the format string should be
"0x%p"to process correctly the “0x” prefix.