ostream reference as a member function

I have a class called Point that has functions for getting and setting x, y, and z coords., distance, and midpoint. I need to write a function that prints the class and must use ostream & displayPoint( ostream & ); as the prototype. I did some googling and came up with

1
2
3
4
5
std::ostream& Point::displayPoint(std::ostream& out)
{
    out << "(" << out.getx() << ", " << out.gety() << ", "  << out.getz();
    return out;
}


in order to print (x, y, z).
My IDE (Xcode) says "No member named 'getx' in std::__1::basic_ostream<char>"

How do I fix this?

I don't understand much about ostream reference so any info on that would be helpful.
well, out does not have the get...() functions. Your Point class has. In other words: remove out.
Topic archived. No new replies allowed.