我如何能在非成员函数使用私有成员变量时,变量是指针?
How can I use a private member variable in a non-member function, when the variable happens to be a pointer?
如果您有指向结构的指针而且指针的值是正确的,那么结构的每个成员变量都将显示正确值。
If you have a pointer to a structure and the value of the pointer is correct, every member variable of the structure will show the correct value.
类的实例的内存快照里有一个vtable的指针,该指针位置在实际的成员变量前面。
The memory image of an instance of a class has one pointer to the vtable of this class, stored in front of the actual data members of the object.
应用推荐