一条语句看不懂了.
#include <stdafx.h>
#include <iostream>
using namespace std;
class CDocument
{
public:
void func() { cout<<"CDocument::func"<<endl;Serialize();}
virtual void Serialize() {cout <<"CDocument::Serialize"<<endl;}
};
class CMyDoc : public CDocument
{
public:
virtual void Serialize() {cout <<"CMyDoc::Serialize"<<endl;}
};
void main()
{
CMyDoc mydoc;
((CDocument *)(&mydoc))->func();
}
((CDocument *)(&mydoc))->func() 这句怎么理解?