I have 2 functions... one is a composition of the other... and then I'm building and overloaded input operator to capture input to enter into some of the variable...when I build, I keep getting
'Steampipe::set_height' : function does not take 0 arguments for error.
First Function/class is Steampipe:>>>>>>>>>>>>>>>
class Steampipe
{
private:
int height,width;
double steamTemp;
public:
Steampipe (int H = 0, int W = 0, double sT = 0.0)
{
height = H;
width = W;
steamTemp = sT;
}
class Fin
{
private:
int width, height; //width and height of fin
int pipeLocationX, pipeLocationY; //grid location of lower left corner
double boundaryTemp; //temperature of fin surroundings
Steampipe Pipe; //steampipe object - COMPOSITION
GridPt GridArray[maxFinHeight][maxFinWidth]; // GridPts - COMPOSITION
public:
void initialize(); // YOU MUST DEFINE
friend istream& operator>>(istream& , Fin& ); // YOU MUST DEFINE
friend ostream& operator<<(ostream& , const Fin& ); // YOU MUST DEFINE
};
Notice PIPE is composition of Steampipe.
Now I define Overloaded input operator:
istream& operator>> (istream& in, Fin& F)
{
char something;
cout << "Enter the height of the fin (integer) >>> ";
in >> F.height;
cout << "Enter the width of the fin (integer) >>> ";
in >> F.width;
cout << "Enter the height of the steampipe (integer) >>> ";
in >> F.Pipe.set_height();
cout << "Enter the width of the steampipe (integer) >>> ";
//in >> F.Pipe.set_width();
cout << "Enter integer coordinates of lower left corner of the steampipe (X,Y) >>> ";
in >> F.pipeLocationX >> something >> F.pipeLocationY ;
cout << "Enter the steam temperature (floating point) >>> ";
//in >> F.Pipe.set_steamTemp();
cout << "Enter the temperature around the fin (floating point) >>> ";
in >> F.boundaryTemp;
return in;
}
When I try to Build I get the error about the F.PIPE.SET_HEIGHT(); does not take zero arguments. If I put something in the braces, I get different errors. The Accessor functions for the Steampipes Height is defined in the Steampipe class included above.
Any help would be appreciated. I just need to figure out what to put for an argument.