Why default argument constructor is called as default constructor

后端 未结 4 706
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-13 02:13
Class A {
public:
       A(int i = 0, int k = 0) {} // default constructor WHY ??
       ~A() {}
};
int main()
{
  A a; // This creates object using defined default          


        
4条回答
  •  渐次进展
    2021-01-13 02:30

    According to c++ standard a default constructor is the one which can be called without arguments.It is also the reason for your quesrion.

提交回复
热议问题