What happens when we try to compile the class definition in following code snippet? class Birds {}; class Peacock : protected Birds {};

Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.

What happens when we try to compile the class definition in following code snippet? class Birds {}; class Peacock : protected Birds {}; Answer: It will compile succesfully.

Question context

This question is part of ⚙️ C++ Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.