Flare Cat
Flare Cat

Reputation: 601

C++ - How to delete a newline that is printed to the console

As the title says, I am wondering how to delete a newline that is printed to the console, if it is possible.

I have seen the following: How to delete a newline using \b

Except that is about using \b to delete a new line, and I would just like to know how to do it, using any possible method.

More specifically: If I have

----
-  -
----

printed to the console, I would like to know how to delete the last two lines, to have just ----.

Thanks in advance!

Note: I left out an OS to see if I can get an answer that would work on any OS.

Upvotes: 1

Views: 1174

Answers (1)

fghj
fghj

Reputation: 9404

As I know, there is no portable way to work with not only current line of output, but with several lines on console.

So you need some kind of wrapper around suitable functionality in each OS, the most portable library for this, as I know is: http://pdcurses.sourceforge.net/

Upvotes: 4

Related Questions