A
A
Alexey Nikolaev2014-12-01 10:54:03
Programming
Alexey Nikolaev, 2014-12-01 10:54:03

How to understand the construction "pointer to pointer"?

Hello!
Suppose there is a construction of the form
void func(int **Variable);
I understand that an expression of the form *Variable will pass a pointer to a variable into the function, but why pass a pointer to a pointer? What could be the point?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Koss1024, 2014-12-01
@Heian

Here with pictures.
cppstudio.com/post/9555

V
Vitaly Pukhov, 2014-12-03
@Neuroware

this is a dumb crutch as a replacement for an array, if you are not programming a Boeing CPU, forget about pointers, in practice they are used either by pros to speed up code or by masochists, usually and more often the latter.

M
mihzas, 2015-03-22
@mihzas

const int**pp2;
int*p1;
const int n = 14;
pp2 = &p1;
*pp2 = &n;
*p1 = 100;
There is such a trick in C for changing a constant variable)
Now n=100

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question