Program to implement Double Pointer - TechnoHindi.Org

Latest

Saturday, August 8, 2020

Program to implement Double Pointer












#include <stdio.h> 
#include <conio.h> 
void main() 
int a= 5; 
int *ptr1; 
int **ptr2; // Double Pointer 
clrscr(); 

ptr1 = &a; // Storing address of 'a' to 'ptr1' 
ptr2 = &ptr1; // Storing address of 'ptr1' to 'ptr2' 

printf("Value of using ptr1 = %d", *ptr1); // Displaying value using single pointer 
printf("\nValue of using ptr2 = %d", **ptr2); // Displaying value using double pointer 

getch(); 
}    
  1. Output :-

No comments:

Post a Comment