🚀 Code smarter. Crack exams faster. Free AI-powered learning on Leyaa.ai →

Print ptr address c

To print pointer address using printf, we need to use %p format specifier.

Example

#include<stdio.h>

int main()
{
    int a = 10;
    int *ptr = &a;

    printf("Address of a = %p\n",ptr);

    return 0;
}

Output

Address of a = 0x7ffeee203bb8


🚀 One platform. 90+ coding courses. 200+ exams.

From programming fundamentals to competitive exam prep — learn with intelligence, not just content. Free on Leyaa.

Explore Leyaa.ai Free →