So I've been trying to make a circle class that can calculate the Area, Diameter, and Circumference of a circle. I wish to be able to do this so I can easily just input the raidus in my main and print the values out. I tried making a friend function, but I believe I have done this wrong? what is wrong with my code, and what should I change? Thank you!
#include "stdafx.h"
#include <iostream>
using namespace std;
class Circle {
public:
int pi, radius, diameter, circumference, area;
Circle() { radius, diameter, circumference, pi, area = 0; };
istream& operator >>(istream& in, Circle& c);
private:
double pi = 3.14;
double radius = 0;
double area = pi * radius * radius
double diameter = radius * 2;
double circumference = 2 * pi * radius;
};
void main()
{
cout << "enter radius radius" << endl;
cin << c.radius;
cout << c.diameter;
cout << c.circumference;
cout << c.area;
system("pause");
}