CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

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

Topics

Missing Base Constructor Call

C++ quiz · Question 26
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};