Grokking Go
0% completed
Pointer to Pointer (Double Pointer)
In Go, a pointer to a pointer (also called a double pointer) is a pointer that stores the address of another pointer. Instead of pointing to a direct value, a double pointer points to the memory address of another pointer, which then points to the actual value.
Declaring a Double Pointer
A double pointer is a pointer that holds the memory address of another pointer.
Syntax for Declaring a Double Pointer
var ptr1 *dataType // Pointer to a value var ptr2 **dataType // Pointer to another pointer
Explanation
- `*dataType
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%