The compiler can automatically generate two constructors - the default constructor and the copy constructor. The default constructor is only generated if there are no explicitly declared constructors in this class. A copy constructor is generated if there is an explicit declaration of this constructor. Therefore, a class can have exactly one constructor only if the copy constructor is explicitly declared.
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати