Sometimes, when I install programs, I see progress bar in console window (or other, dynamic changing text). It is displayed, and changing in the same row of string. When I use printf or other function, I write next text, but I can’t modify in console window already existing text. How can I do it through C?
Sometimes, when I install programs, I see progress bar in console window (or other,
Share
The easiest way for this kind of effects is to use the caret return
\rcharacter that lets you write over the previous line.If you’d like to have direct access to the console’s buffer (i.e. writing in specific X/Y position instead of line-by-line), then you’re probably looking for a helper library like
pdcurses.