I'm doing a project for school and I've run into a problem. I have to reset values of a cylinder (height and diameter), back to the values used in the default constructor within a function. Here is what I have so far:
My Class
class cylinder
{
public:
cylinder();
cylinder(double x, double y);
double get_height();
void set_height(double height);
double get_diameter();
void set_diameter(double diameter);
void calculate_volume(double height, double diameter);
void original_cylinder(double height, double diameter);
void new_cylinder(double height, double diameter);
private:
struct a_cylinder
{
double height;
double diameter;
} silly;
};
default constructors:
//default constructor
cylinder::cylinder()
{
silly.height = 1.0;
silly.diameter = 1.0;
}
cylinder::cylinder(double x, double y)
{
silly.height = x;
silly.diameter = y;
}
And this is the code I need to fix
void cylinder::original_cylinder(height, diameter)
{
cylinder();
}
Why can I not call the constructor?