float* p;
if p points to float variable,say float x; and we want to print the address of x stored in p using p. then which format specifier should we use
%p format specifier can be used to print pointer address. See following illustration:
float x; // Variable x
printf("%p ", (void *)&x); // Printing address of variable x
printfs ā%pā format requires an argument of type void*, thus the type casting.
Hope it helps, Best Luck