error C2797 : list initialization inside member initializer list

前端 未结 3 1170
日久生厌
日久生厌 2021-01-14 10:22

I was watching MVA\'s tutorial on C++ and the code I\'m mentioning below is written by Kate not me. However she seems to get around with it without compiling showing any err

3条回答
  •  醉梦人生
    2021-01-14 10:43

    I solve it.

    class Namedrectangle : public Rectan
    {
        public:
        Namedrectangle(){}
    
        Namedrectangle(string intname, int init_width, int init_height) 
             : Rectan{ init_width, init_height }
        {
            this->_name=intname;************
        }
    
        string get_name() const
        {
            return _name;
        }
    
        private:
        string _name;
    };
    

    I think İt can't initialize because variable can't find or load

提交回复
热议问题