Quantcast
Browsing latest articles
Browse All 159 View Live

By: nascardriver

The batting average was also initialized. I updated the lesson, thanks!

View Article


By: Question on quiz

Can't we define a method for outputting an object in the base class, Fruit, and use that method to output the object of Banana class without having to write a method for it separately?

View Article


By: Question on quiz

Can't we define a method for outputting an object in the base class, Fruit, and use that method to output the object of Banana class without having to write a method for it separately?

View Article

By: Imayan

Can't we define a method for outputting an object in the base class, Fruit, and use that method to output the object of Banana class without having to write a method for it separately?

View Article

By: Question on quiz

Is the following correct too? I wanted both Banana and Apple class to inherent output method from the base, Fruit....

View Article


By: nascardriver

You solution doesn't output the apple's fiber content. To do that, you need to overload `operator<<` for `Apple`.

View Article

By: Imayan

I forgot that! You were right. Thank you

View Article

By: riad

but we can't initialize a reference with r-value (std::string& name="")???

View Article


By: Yolo

I have a question regarding the const m_id in "Initializing base class members" paragraph. You write:"However, when the base class constructor finishes, the derived class constructors initialization...

View Article


By: nascardriver

That's exactly what the paragraph you took the quote from is saying. It's a hypothetical scenario explaining why the derived constructor cannot initialize members of the base class.

View Article
Browsing latest articles
Browse All 159 View Live