第十章 复习题

    xiaoxiao2021-08-21  84

    1到4问题都太抽象了,这里就略过了

    5.

    class Account

    {

    private:

    string name;

    int ID;

    double deposit;

    public:

    show();

    void add();

    void withdraw();

    }

    6.

    构造函数在声明一个类的对象的时候调用,析构函数在这个对象使用结束之后调用

    7.

    Account::account(string name1, int id, double d) {

    name = name1;

    ID = id;

    deposit = d;}

    8 也略过了

    9. const string nameShow() const {

    return company;}

    const int sharesShow() const {

    return shares;}

    10. this 是对象的地址,*this是对象本身

    转载请注明原文地址: https://ju.6miu.com/read-676810.html

    最新回复(0)