Cursor position, cout problem

Hello,

I have a problem with displaying text using cout << in a user-specified cursor position
1
2
3
4
5
6
7
8
9
10
class kord {
 
int posX, posY;
std :: string text;
public:
// set the position
// function to display text
// function return text
// ....
};  



The user gives the coordinates in which cout<< should start to printing.
When I am printing through the functions from the kord class I have no problem because I have access to these variables (posX,posY), but when I return the text to the new string variable in the main and write the cout << it starts in new line .

Override operator<< for a class object does not fix problem because it prints regural string variable.

Does anyone have an idea? What should I do or read about
You should think of standard streams literally like putting floating letters in a flowing river. You don't get to choose where they end up, that's up to the person taking them out of the river. You can only choose what to send.
Standard streams don't have a concept of horizontal and vertical position.
Topic archived. No new replies allowed.