#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class A
{public:
A(const char *na){strcpy(name,na);}
private:
char name[80];
};
class B:public A
{ public:
B(const char *nm):A(nm){}
void show();
};
void B::show()
{ cout<<"name:"<<name<<endl;
}
void main()
{ B b1("B");
b1.show();
}
|