
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
How to define pointer to pointer in C language?
Declaring double pointer is similar to declaring pointer in C programming language. The difference is that only we need to add an additional ‘*’ before the name of pointer.
Syntax
The syntax is given below for declaring double pointers −
int **ptr;
Example
Following is the C program for pointer to pointer −
#include<stdio.h> // C program to demonstrate pointer to pointer int main(){ int element = 24; // pointer for element int *ptr2; // double pointer for ptr2 int **ptr1; // storing address of value in ptr2 ptr2 = &element; // Storing address of ptr2 in ptr1 ptr1 = &ptr2; // Displaying value of element using // both single and double pointers printf("element value = %d
", element ); printf("element value using single pointer = %d
", *ptr2 ); printf("element value using double pointer = %d
", **ptr1); return 0; }
Output
When the above program is executed, it produces the following result −
element value =24 element value using single pointer = 24 element value using double pointer = 24
- Related Articles
- Explain the concept of pointer to pointer and void pointer in C language?
- Double Pointer (Pointer to Pointer) in C
- Differentiate the NULL pointer with Void pointer in C language
- How to access the pointer to structure in C language?
- Explain the Union to pointer in C language
- How to create a pointer for strings using C language?
- What is void pointer in C language?
- C program to display relation between pointer to pointer
- Explain the concept of Array of Pointer and Pointer to Pointer in C programming
- Explain the concept of pointer accessing in C language
- What do you mean by pointer to a constant in C language?
- Explain the dynamic memory allocation of pointer to structure in C language
- How to declaring pointer variables in C/C++?
- Pointer to an Array in C
- How to declare a pointer to a function in C?

Advertisements