Q:

Write a program in c to demonstrate pointer to a pointer(double pointer)

0

Write a program in c to demonstrate pointer to a pointer(double pointer)

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:
#include<stdio.h>
#include<conio.h>
int main()
{
int a=10;
int *p;
int **pp;
p=&a; // pointer is pointing to the address of a
pp=&p; // pointer pp is a double pointer pointing to the adress of pointing p
printf("address of a: %x\n"); // adress of a will be printed
printf("address of p: %x\n",pp); // adress of p will be printed
printf("value stored at p: %d\n",*p);
printf("value stord at pp: %d\n",**pp);
getch();
}

Output:

address of a: e100ad18
address of p: e100ac08
value stored at p: 10
value stord at pp: 10

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a program to demonstrate the use of malloc a... >>
<< Write a c program to demonstrate array of structur...