**在C++有什么用

What is the use of ** in C++?

本文关键字:什么 C++      更新时间:2023-10-16
Segment computeSegment(Triangle& t, float z)
{
    Vertex** vs = t.vertices;
    // ...
}

在这里,Vertex是结构的名称。 你能告诉我**Vertex** vs = t.vertices;中的含义是什么吗?

Vertex*是指向顶点,因此Vertex**是指向指针到顶点 - 另一个间接级别。

例如:

int i = 0;
int * iPtr = &i;        // iPtr -> i
int ** iPtrPtr = &iPtr; // iPtrPtr -> iPtr -> i