In a declaration, it means it’s a pointer to a pointer:
int **x; // declare x as a pointer to a pointer to an int
When using it, it deferences it twice:
int x = 1;
int *y = &x; // declare y as a pointer to x
int **z = &y; // declare z as a pointer to y
**z = 2; // sets the thing pointed to (the thing pointed to by z) to 2
// i.e., sets x to 2
Related Contents:
- What does ‘**’ mean in C?
- Concatenate two string literals
- Meaning of *& and **& in C++
- What does ‘&’ do in a C++ declaration?
- Why do some people prefer “T const&” over “const T&”?
- Why is the dereference operator (*) also used to declare a pointer?
- Accessing the [] operator from a pointer
- Given a 2D array int[][], what does it mean to create a pointer int(*)[]?
- What are the differences between a pointer variable and a reference variable?
- When should static_cast, dynamic_cast, const_cast, and reinterpret_cast be used?
- Why should I use a pointer rather than the object itself?
- What exactly is nullptr?
- When should I use the new keyword in C++?
- Is it safe to delete a NULL pointer?
- Pointer to class data member “::*”
- What does the question mark and the colon (?: ternary operator) mean in objective-c?
- Is the sizeof(some pointer) always equal to four? [duplicate]
- Can I use if (pointer) instead of if (pointer != NULL)?
- Const before or const after?
- Pointers, smart pointers or shared pointers? [duplicate]
- Is there a better way to express nested namespaces in C++ within the header
- Can I call memcpy() and memmove() with “number of bytes” set to zero?
- The tilde operator in C
- What is the meaning of “operator bool() const”
- Difference between function arguments declared with & and * in C++
- Why do people use __ (double underscore) so much in C++
- Testing pointers for validity (C/C++)
- Correct way of declaring pointer variables in C/C++ [closed]
- error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
- Do all C++ operators return something?
- const char* and char const* – are they the same?
- How does dereferencing of a function pointer happen?
- Purpose of a “.f” appended to a number?
- Difference between pointer to a reference and reference to a pointer
- What is the operator “” in C++?
- dereferencing a pointer when passing by reference
- Is there any reason to check for a NULL pointer before deleting?
- Class members that are objects – Pointers or not? C++
- Making operator
- A pointer to 2d array
- Difference between const. pointer and reference?
- Pass by pointer & Pass by reference [duplicate]
- Why do try..catch blocks require braces?
- Why is the data type needed in pointer declarations?
- Create new C++ object at specific memory address?
- Declaring type of pointers?
- convert reference to pointer representation in C++
- Properly destroying pointers in an std::map
- Pointer to class member as template parameter
- How should I pass objects to functions?