[C++]空指针访问静态成员函数

class VolumeManager {this

public :it

static void Hello() {cout <<"Hello World!"};class

}static

void main(){poi

VolumeManager *vm = NULL;co

//Ok to run, like VolumeManager::Hello();cas

//because there is no this pointer.void

//C++ is not C, In general in C++, it should be Hello(this), in this case no this;

vm->Hello();

}

相关文章
相关标签/搜索