D
deanfamily
Here's the problem:
I have a function that references another one in this manner:
class circleType: public pointType
so, pointType is redefined by circleType, thereby giving circleType access
to all the functions in pointType if need-be. Here is the function I am
using in pointType:
void pointType::setCoords(double xCoord, double yCoord)
{
pointX = xCoord;
pointY = yCoord;
}
it is being accessed in circleType in this manner:
void circleType::getCoords(double xCoord, double yCoord)
{
//set the external point using the pointType header
pointType::setCoords(pointX, pointY);
cout << "The coordinate entered is: (" << pointX << "," << pointY << ")";
cout << endl;
}
My cout works, but the point it prints is (0,0), meaning that the variables
aren't being passed into the function, and it is just defaulting to the
value of 0 for both.
Any thoughts?
I have a function that references another one in this manner:
class circleType: public pointType
so, pointType is redefined by circleType, thereby giving circleType access
to all the functions in pointType if need-be. Here is the function I am
using in pointType:
void pointType::setCoords(double xCoord, double yCoord)
{
pointX = xCoord;
pointY = yCoord;
}
it is being accessed in circleType in this manner:
void circleType::getCoords(double xCoord, double yCoord)
{
//set the external point using the pointType header
pointType::setCoords(pointX, pointY);
cout << "The coordinate entered is: (" << pointX << "," << pointY << ")";
cout << endl;
}
My cout works, but the point it prints is (0,0), meaning that the variables
aren't being passed into the function, and it is just defaulting to the
value of 0 for both.
Any thoughts?