← Back to Question List
C++ Quiz #25
Default Private Inheritance
This code fails to compile at the indicated line. What is the issue?
📄 Code
1#include <iostream>2using namespace std;34class Shape {5public:6 void draw() {7 cout << "Drawing shape" << endl;8 }9};1011class Circle : Shape { // Note: no 'public' keyword12public:13 void drawCircle() {14 draw(); // This works fine15 }16};1718int main() {19 Circle c;20 c.draw(); // ERROR on this line21 return 0;22}