In the printf function, what data type does % p represent? printf % p
On the Q & A channel today, I saw a netizen asking % p what is output. I checked it and made a record here.
<Span style = "font-size: 18px;" >#include <stdio. h> void main () {int arr [5] = {10, 20, 30, 40, 50}; int I = 0; printf ("data: \ n "); printf ("decimal data: \ n"); for (I = 0; I <5; I ++) {printf ("% d \ t ", arr [I]);} printf ("\ n pointer in hexadecimal format: \ n"); for (I = 0; I <5; I ++) {printf ("% p \ t", arr [I]);} printf ("\ n normal hexadecimal representation of data: \ n "); for (I = 0; I <5; I ++) {printf (" % x \ t ", arr [I]);} printf ("\ n address: \ n"); printf ("\ n decimal address: \ n "); for (I = 0; I <5; I ++) {printf ("% d \ t", & arr [I]);} printf ("\ n pointer in hexadecimal format: \ n"); for (I = 0; I <5; I ++) {printf ("% p \ t", & arr [I]);} printf ("\ n normal hexadecimal address: \ n "); for (I = 0; I <5; I ++) {printf ("% x \ t", & arr [I]) ;}</span>
Data:
Decimal data:
10 20 30 40 50
Data in hexadecimal format:
0000000A 00000014 0000001E 00000028 00000032
Common hexadecimal data:
A 14 1e 28 32
Address:
Address in decimal format:
1244980 1244984 1244988 1244992 1244996
The address in hexadecimal format:
0012FF34 0012FF38 0012FF3C 0012FF40 0012FF44
Normal hexadecimal address:
12ff34 12ff38 12ff3c 12ff40 12ff44 Press any key to continue