The usual way with something like ncurses. If you work on Windows, it has built-in console functions, so you can do the same without any additional libraries (although they need time to understand). If you want only one line of output, you can use '\r'to return to the beginning of the current line and / or \bto return to previous characters (convenient if yoy just wants to rewrite a few small bits and parts).
source
share