I have some code that was given to me to finish but a few things are unfamiliar to me. First of all, what's the point of the member initializer in the first function?
class Circle {
private:
double r;
public:
Circle(double radius) : r(radius) {}
double get_perimeter()
{
return 2*PI*r;
}
double get_radius()
{
return get_perimeter()/2*PI;
}
};
and then in my main()
function:
int main()
{
double radius;
cin >> radius;
Circle c(radius);
cout << c.get_radius << endl;
return 0;
}
The Circle c(radius);
line makes no sense to me. Can someone narrate me those few lines that I addressed?