In the printf function, what data type does % p represent? printf % p

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.