int ** understanding

int ** understanding

** P int;
int * P, easier to understand, is a pointer to the int type pointer. So here int ** p What is it?
For this particular form, first of all it is certain that p is a pointer, not only because the front p * number * number two and there, so it must be a pointer.
And then the two numbers * What does it mean?
The int ** p broken down into the following form, and int * p comparison, will see more clearly

int           * p; //指针p指向 int类型
int *         * p;//指针p指向int * 类型

In fact, the difference between the above two forms is that: a pointer to a different type of content, a pointer to a pointer to an int type int *

int a = 10;
int *q;
int **p;

q = &a;//q 指向 a
p =&q; //p 指向q, q是一个int类型指针

After the image memory block has been executed as follows:

Here Insert Picture Description
----------------
Disclaimer: This article is CSDN blogger "hw2169" original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/hw2169/article/details/103792090

Released two original articles · won praise 0 · Views 65

Guess you like

Origin blog.csdn.net/hw2169/article/details/103847023