Correct format specifier to print pointer or address?

Which format specifier should I be using to print the address of a variable? I am confused between the below lot.

%u – unsigned integer

%x – hexadecimal value

%p – void pointer

Which would be the optimum format to print an address?

5 Answers
5

Leave a Comment