GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — C++ Pointer To Pointer (Double Pointer) - GeeksforGeeks C++ Pointer To Pointer (Double Pointer)Last Updated : 18 Jun, 2026 A Double Pointer (Pointer to Pointer) is a pointer that stores the address of another pointer. It provides an additional level of indirection for accessing data.
![]() Declaring a Pointer to PointerA pointer to pointer is declared by placing an additional * before the pointer name. The first * represents a pointer, while the second * indicates that the pointer stores the address of another pointer. Syntax
Here,
Example: Declaring and Using a Double Pointer
Output Value of variable :- 169 Value of variable using single pointer :- 169 Value of variable using double pointer :- 169 Explanation: pointer1 stores the address of variable, while pointer2 stores the address of pointer1. Dereferencing pointer2 once gives pointer1, and dereferencing it a second time retrieves the value stored in variable. Pointer to Pointer RepresentationThe following diagram illustrates the relationship between a variable, a pointer, and a pointer to pointer. ![]() Working of a Double PointerA double pointer introduces two levels of indirection. ![]()
Size of a Double PointerA double pointer occupies the same amount of memory as a normal pointer because both store only memory addresses. The size depends on the system architecture rather than the pointer type.
Output Size of normal Pointer: 8 Size of double Pointer: 8 Explanation: Both ptr and doublePtr store memory addresses, so they occupy the same amount of memory. The actual size depends on the architecture of the system.
Applications of Double PointerDouble pointers are commonly used in the following situations:
Comment ExploreStandard Template Library(STL) Practice & Problems |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |