Point p(3,4); char str[15]; sprintf(str, "(%d, %d)", p.getX(), p.getY()); cout << str << endl; Output: (3,4)