https://stackoverflow.com/questions/670734/what-is-a-pointer-to-class-data-member-and-what-is-its-use
#面向对象程序设计
#面向对象程序设计
Stack Overflow
What is a pointer to class data member "::*" and what is its use?
I came across this strange code snippet which compiles fine:
class Car
{
public:
int speed;
};
int main()
{
int Car::*pSpeed = &Car::speed;
return 0;
}
Why does C++ have this
class Car
{
public:
int speed;
};
int main()
{
int Car::*pSpeed = &Car::speed;
return 0;
}
Why does C++ have this