In C language, we have seen different format specifiers. Here we will see another format specifier called %p. It is used to print pointer type data. Let's see an example to understand better.
#include<stdio.h> main() { int x = 50; int *ptr = &x; printf("The address is: %p, the value is %d", ptr, *ptr); }
The address is: 000000000022FE44, the value is 50
The above is the detailed content of What is the use of '%p' in printf in C?. For more information, please follow other related articles on the PHP Chinese website!