0
#include<iostream.h>
class X{
private:
int x;
public:
X() {}
void func() {
cout<<"In func()"<<endl;
}
};
int main(void)
{
X *x=NULL;
x->func();
return 0;
}
我与O/P真的很惊讶,谁能请解释我X如何访问FUNC() 。
这是未定义的行为。没有解释 - 发生任何事情。 –
@Bo - 好吧,*是*的解释,而不是C++标准。有关C++如何编译的更多信息。无论如何,无论如何评论+1,未定义的行为。 – Steve314