#include <iostream>
using namespace std;
class Circle{
protected:
double radius;
char* color;
public:
Circle(double radius, char* color){
this->color=color;
this->radius=radius;
}
double getRadius(){
return this->radius;
}
double setRadius(double radius){
this->radius=radius;
}
char* getColor(){
return this->color;
}
char* setColor(char* color){
this->color=color;
}
double getArea(){
return 3.14*(this->radius)*(this->radius);
}
};
class Cylinder: public Circle{
double height;
public:
Cylinder(double radius, char* color,double height){
this->height=height;
}
double getVolume(){
return getArea()*height;
}
};
int main(){
Cylinder cylinder1=Cylinder(6,"blue",3);
cout<<cylinder1.getVolume();
}
em bị lỗi : no matching function for call to Circle::Circle()
dù là em làm trong một file cpp


83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?