C++:初学者,这段代码有错,谁能解释下出错的原因
#include <iostream>using namespace std;class Circle{public: Circle(double radius = 0){ Pi =3.14; this->radius = radius; } double getArea(){ return Pi* radius* radius; } double getCircumference(){ return 2*Pi* radius; }private: const double Pi ; double radius ; }; int main(int argc, char *argv[]){ cout << "Enter a radius: ";double Radius = 0;cin >> Radius;Circle MyCircle(Radius);cout << "Circumference = " << MyCircle.getCircumference() << endl;cout << "Area = " << MyCircle.getArea() << endl; return 0;}
class Circle{public: Circle(double radius = 0):Pi(3.14){ //Pi =3.14; this->radius = radius; } double getArea(){ return Pi* radius* radius; } double getCircumference(){ return 2*Pi* radius; }private: const double Pi ; double radius ;};