How do I erase printed characters in a console application(Linux)?

前端 未结 6 1613
慢半拍i
慢半拍i 2020-12-14 19:54

I am creating a small console app that needs a progress bar. Something like...

Conversion: 175/348 Seconds   |==========          |  50%

My

6条回答
  •  不知归路
    2020-12-14 20:26

    to erase a previously printed character, I print a backspace after it: print "a" print "\b"

    will print nothing (actually it will print and then a backspace, but you probably won't notice it)

提交回复
热议问题