CJCoding With Joseph
15per day
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
C++ Quiz #28

Cannot Create Abstract Object

easyPolymorphism

This code fails to compile. What is the issue?

📄 Code

1#include <iostream>
2using namespace std;
3 
4class Shape {
5public:
6 virtual double area() = 0;
7};
8 
9int main() {
10 Shape s;
11 cout << s.area() << endl;
12 return 0;
13}