void main()
{
GraduateStudent gs;
Student *ps;
ps=dynamic_cast<Student*>(&gs);
if(ps!=NULL)
ps->display();
else
cout<<"ok"<<endl;
}
{
GraduateStudent gs;
Student *ps;
ps=dynamic_cast<Student*>(&gs);
if(ps!=NULL)
ps->display();
else
cout<<"ok"<<endl;
}
enable RTTI 复选上了
以下是projection option:
/nologo /MLd /W3 /Gm /GR /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/12_1_BaseDrivedTest.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c