回覆列表
  • 1 # 使用者6338718972581

    #include

    using namespace std;

    class baseclass{

    public:

    int number;

    baseclass(){}

    baseclass(int);

    };

    class derivedclass:public baseclass{

    public:

    int number_derived;

    derivedclass(){}

    derivedclass(int);

    };

    baseclass::baseclass(int num)

    {

    number = num;

    cout

    cout

    }

    derivedclass::derivedclass(int num)

    {

    number_derived = num;

    cout

    cout

    }

    int main()

    {

    baseclass Base(10);

    derivedclass DBase(29);

    return 1;

    }

  • 中秋節和大豐收的關聯?
  • 珊瑚島在世界地圖的哪裡?