previous | start | next

Writing a toString() Method: 8

The implementation of Pair's toString() method

    1   string Pair::toString() const
    2   {
    3     stringstream ss;
    4     ss << x << " " << y;
    5     return ss.str();
    6   }
     


previous | start | next