i'm beginner in c++ and i get a problem
the problem is
error C2065: 'radius' : undeclared identifier
and the program
# include <iostream>
using namespace std;
class circle
{
public:
void setRadius (double r)
{
[B]-[/B] radius = r; //here the problem and i don't know why it's keep telling me " undeclared identifier "
}
double getRadius()
{
return radius;
}
double getdiameter()
{
return 2 * radius;
}
double getarea()
{
return 3.14 * radius * radius;
}
double getcircumference()
{
return 3.14 * radius * 2;
}
private:
double raduis;
};
int main()
{
circle candenter;
candenter.setRadius (1.5);
cout << "Please enter the radius" << candenter.getRadius() << endl;
cout << "Circle information using function members:\n" << endl;
cout << "Diameter is " << candenter.getdiameter() << endl;
cout << "Circumference is " << candenter.getcircumference() << endl;
cout << "Area is \n" << candenter.getarea() << endl;
cout << "Circle informationusing display function:\n" << endl;
return 0;
}
do you know why ?
and thanks