Question: I'm just curious whether it is possible to somehow declare something similar to cout but to define its function. For example:

```
SetCursorPosition(output_handle, some_COORD);
cout_coord << "Hi\nthere!";

```

to produce this **output**:

```
 .
               Hi
               there!

```

Answer: 
You could use operator overloading to make `<<` do basically anything (just google "c++ operator overloading", you'll find tons of information), but such a thing as in your question is generally considered **abuse of operator overloading**. Overloading operators is intended to make code easier to read. In C++, everyone knows that `<<` means "output something", just like `+=` means "mathematically add something" and `=` means "assign something".

When I see `<<` in some piece of code, then I certainly don't read it as "set cursor position and then print text". You could implement it like this, but it's bad programming style, akin to misnaming ordinary functions.
Thanks to Christian Hackl and another user that removed their answer I did a research and found the answer I was looking for. 

If anyone is still curious my example in the question became:

```
std::ostream& operator<<(std::ostream& left, const char * right)
{
    string sRight = right;
    CONSOLE_SCREEN_BUFFER_INFO con;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &con);
    COORD xy;
    xy.X = con.dwCursorPosition.X;
    xy.Y = con.dwCursorPosition.Y;
    for (int i = 0; i < sRight.length(); i++)
    {
        if (sRight[i] == '\n')
        {
            xy.Y++;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), xy);                
            continue;
        }
        cout << sRight[i];
    }
    return left;
}

```

And then you just:

```
SetConsoleCursorPosition(output_handle, some_COORD);
cout_coord << "Hi\nthere!";

```

And "Hi" and "there!" are one under the other for every x given with some\_COORD!