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 #26

Missing Base Constructor Call

easyInheritance

This code fails to compile. What is the issue?

📄 Code

1#include <iostream>
2#include <string>
3using namespace std;
4 
5class Vehicle {
6public:
7 string brand;
8 Vehicle(string b) : brand(b) {}
9};
10 
11class Car : public Vehicle {
12public:
13 int doors;
14 Car(int d) : doors(d) {}
15};