此代码显示错误“len”和“wid”未在此范围内声明我该如何解决?
class Shape {
private:
double length;
double width;
public:
Shape(double len, double wid) {
length = len;
width = wid;
}
double getArea() {
return len*wid;
}
};
int main() {
Shape Shape(2,4);
cout << Shape.getArea();
}
Run Code Online (Sandbox Code Playgroud) c++ ×1