//CeShi.h
#ifndef CESHI_H
#define CESHI_H
#include
using namespace std;
class CeShi
{
private:
int a;
protected:
int b;
public:
CeShi(){cout << "CeShi()!\n";}
void display();
void show();
virtual ~CeShi(){ cout << "~CeShi()!\n"; }
};
#endif
//CeShi.cpp
#include "CeShi.h"
#include
using namespace std;
void CeShi::display()
{
cout << "YES"<< endl;
}
void CeShi::show()
{
cout << "Show() CeShi!";
cout << endl;
}
//main.cpp
#include
#include "CeShi.h"
using namespace std;
CeShi *p;
int main ()
{
p->show();
return 0;
}
//这个运行的结果是:Show() CeShi!
//请问下为什么?谢谢。