friend ostream& operator<< (ostream& os, const Rectangle& myRectangle);and in a .cpp file somewhere I have this is as the function definition:
ostream& operator<<(ostream& os, const Rectangle& myRectangle) { os << "Width: " << setw(20) << myRectangle.GetWidth << endl; os << "Height: " << setw(20) << myRectangle.GetHeight << endl; os << "Area: " << setw(20) << myRectangle.GetArea << endl; os << "X: " << setw(20) << myRectangle.GetXLocation << endl; os << "Y: " << setw(20) << myRectangle.GetYLocation << endl; os << "Rectangles Created: " << setw(20) << myRectangle.GetRectanglesCreated << endl; os << "Rectangles Existing: " << setw(20) << myRectangle.GetRectanglesExisting << endl; os << "Color: " << setw(20) << "R:" << myRectangle.GetBlockColour.redNumber << " G:" << myRectangle.GetBlockColour.greenNumber << " B:" << myRectangle.GetBlockColour.blueNumber << " A:" << myRectangle.GetBlockColour.alphaNumber << endl; }I must be doing something wrong because for every accessor I'm getting an error that reads:
function call missing argument list; use '&Rectangle::(accessor name)' to create a pointer to member
What am I doing wrong?