class Document
{
public:
Document() {};
Document(const char*nm);
private:
const char*name;
};
Document::Document(const char*nm) :name(nm) {};
class Book:public Document
{
public:
Book(const char*nm, long pagecount);
private:
long pageCount;
};
Book::Book(const char*nm, long pagecount) :Document(nm),pageCount(pagecount){}; // Document(nm)是使用nm初始化父类Document,进而调用父类构造函数初始化name吗?