Pointer Basics
For every value type or pointer type V, there is a corresponding pointer type V*. A
pointer instance holds the address of a variable. Pointer types can be (unsafely) cast
to any other pointer type. The main pointer operators are:
Operator Meaning
& The address-of operator returns a pointer to the address of a variable
* The dereference operator returns the variable at the address of a pointer
-> The pointer-to-member operator is a syntactic shortcut, in which x->y is equivalent to (*x).y
指针基础知识
对于每个值类型或指针类型V,都有一个对应的指针类型V*。一个
指针实例保存变量的地址。指针类型可以被强制转换
指向任何其他指针类型。指针操作符主要有:
运营商的意义
&地址操作符返回一个指向变量地址的指针。
* dereference操作符返回指针地址处的变量
->指针对成员运算符是一个语法捷径,其中x->y等于(*x).y