Two constructors, which is default?

后端 未结 6 1516
深忆病人
深忆病人 2020-12-12 02:29

Okay I got a pretty simple assignment.

I got these two constructors for class Person:

Person( const string &, const string &, const string &a         


        
6条回答
  •  天涯浪人
    2020-12-12 03:03

    Both the constructors will be matched only when the signature of the call statement matches. The default constructor is always the constructor with no arguments

    Person(){}
    

提交回复
热议问题