Trong C có nhiều định dạng specifier. Ở đây ta xem %p dùng để in dữ liệu kiểu con trỏ.
Ví dụ
#include <stdio.h>
int main() {
int x = 50;
int *ptr = &x;
printf("The address is: %p, the value is %d", ptr, *ptr);
return 0;
}
Kết quả
The address is: 000000000022FE44, the value is 50