谁能解释下这个这是为什么.
#include <iostream.h>
class Test
{
public:
int danger[2];
virtual void hello(void)
{
cout<<"Hello!"<<endl;
}
};
void myFun(void)
{
cout<<"You are danger!"<<endl;
}
Test obj1,obj2,*pobj;
void main()
{
pobj=&obj2;
pobj->hello();
int *pfun=(int *)(int)&myFun;
obj1.danger[3]=(int)&pfun;
pobj->hello();
}
[此贴子已经被作者于2006-11-13 14:31:21编辑过]