I have looked at a ton pages relevant to printing pointers and I still need clarity.
I read here: http://bytes.com/forum/thread219302.ht ml , that to print with %d you "need to cast the pointer to void* ". WHY??
How do I properly print:
I only use %p to print the address of a pointer right? Is that when I have to use void * ?
thanks!!
I read here: http://bytes.com/forum/thread219302.ht ml , that to print with %d you "need to cast the pointer to void* ". WHY??
How do I properly print:
Code:
printf("%?", &ptr); //what format specifier goes here, and what does it print
or
printf("%?", ptr); //to print the value?
or
printf("%?", *ptr); //what would this do?
thanks!!
Comment