- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of `%p` in printf in C?
In C we have seen different format specifiers. Here we will see another format specifier called %p. This is used to print the pointer type data. Let us see the example to get a better idea.
Example
#include<stdio.h> main() { int x = 50; int *ptr = &x; printf("The address is: %p, the value is %d", ptr, *ptr); }
Output
The address is: 000000000022FE44, the value is 50
Advertisements