Base Copy constructor not called

前端 未结 6 1985
悲&欢浪女
悲&欢浪女 2021-02-10 07:44
class Base
{
      public:
      int i;

      Base()
      {
          cout<<\"Base Constructor\"<

        
6条回答
  •  爱一瞬间的悲伤
    2021-02-10 08:32

    Thank you very much. I got it. It means that the call to the base class copy constructor is automagivccally done in the derived's default copy constructor. Whereas in the second case since i am writing the derived's copy constructor i must make an explicit call to the base's copy constructor. Thanks again

提交回复
热议问题