class Phone {
public:
Phone(){
}
Phone(int num):phoneNum(num)
{
}
void shout() {
cout << "ccc" << endl;
}
void shout2() {
if (this == NULL) {
return;
}
cout << this->phoneNum << endl;
}
int phoneNum;
};
void test() {
Phone* p = NULL;//空指针访问成员函数
p->shout();
p->shout2();
}
int main() {
test();
}