在c语言中,我们已经见过不同的格式说明符。这里我们将看到另一个称为%p的格式说明符。它用于打印指针类型的数据。让我们看一个示例以更好地理解。
示例#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
以上就是c 中 printf 中的“%p”有什么用?的详细内容。