C++ÃæÏò¶ÔÏó³ÌÐòÉè¼Æ½Ì³Ì£¨µÚ3°æ£©¡ª-³ÂάÐË£¬ÁÖС²è¿ÎºóϰÌâ´ð°¸ ÏÂÔØ±¾ÎÄ

.

public:

Birthtime(char name[], int m, int d, int y, int h, int mi, int s): Time(h, mi, s), Date(m, d, y) {

strcpy(Childname, name); }

void showName() {

cout << \ÎÒµÄÃû×ÖÊÇ£º \ << Childname << endl; } private:

char Childname[25]; }; int main() {

Birthtime b(\, 3, 6, 2012, 11, 12, 42); b.showName(); b.Time::display(); b.Date::display(); return 0; }

¾«Ñ¡·¶±¾

.

4.22

#include using namespace std; #include

class person { protected:

char number[25]; char name[25]; public:

person(char num[], char na[]) {

strcpy(number, num); strcpy(name, na); }

void showName() {

cout << \±àºÅ£º\ << number << \ÐÕÃû£º\ << name; }

¾«Ñ¡·¶±¾