I would be very nearly eternally grateful if someone would explain how to convert a void pointer's target (eg 0xda9f000) into a string in C. Both my own brain and google have failed me on this one. I can do this in printf using the wonderfully inelegant line:
printf("Value:'%p' ", *((unsigned int *)point));
But I want to save the result to a char array.
I have tried:
sprintf(buffer, "%p", *((unsigned int *)point));
But that writes the address in/of $point to $buffer rather than the value that $point is pointing at.
Thanks in advance. I hope my query makes sense.
Nevermind. The sprintf line was working, just I was formatting the output in the wrong way to give myself a misleading impression. Sorry if I wasted anyone's time.
Edited 7 Years Ago by hoke: n/a