给定⼀个简单的类定义如下,( )语句在类的外部正确地创建了⼀个 Circle 对象并调⽤了 getArea 函数?
1 class Circle { 2 private: 3 double radius; 4 public: 5 Circle(double r) : radius(r) {} 6 double getArea() { 7 return 3.14 * radius * radius; 8 } 9 };
Circle c = Circle(5.0); c.getArea(c);
Circle c(5.0); getArea(c);
Circle c = new Circle(5.0); c.getArea();
Circle c(5.0); c.getArea();