Vote count:
0
class Wood { public: enter code here
Wood(); enter code here
Wood(const Wood&); //copy constructor enter code here
~Wood();
private: enter code here
string price; };
Wood::Wood(const Wood& orig) { enter code here
price(orig.price); //error, why? }
Wood::Wood(const Wood& orig) : price(orig.price) { //rigth
}
If i using the construct initialize and it was correct. But if if using "price(orig.price)" and it will error, why?
asked 58 secs ago
About copy construct
Aucun commentaire:
Enregistrer un commentaire