class test { static void fun() { cout<<"test fun\n"; } }; test *p=NULL; p->fun(); 调用没有问题,因为静态成员函数是属于类的,不需要类的实例就能直接调用,上述p类指针只是其中的一种调用方式而已,不要混淆了
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号