Lesson 69.2 I got stuck | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Lesson 69.2 I got stuck

Where to insert the access specifier? Which syntax.

5th Dec 2021, 8:39 PM
Vladimir Kushner
Vladimir Kushner - avatar
1 Answer
+ 16
Use protected access specifier for price and weight: class Product { protected: double price; int weight; ... } And extend the Product class: class Fruit : public Product
6th Dec 2021, 10:14 AM
Igor Makarsky
Igor Makarsky - avatar