Clearing output of a terminal program Linux C/C++

后端 未结 7 581
盖世英雄少女心
盖世英雄少女心 2020-11-27 14:29

I\'m interested in clearing the output of a C program produced with printf statements, multiple lines long.

My initial guess was to use

 printf(\"ou         


        
7条回答
  •  无人及你
    2020-11-27 15:16

    In fact, when you capture/redirect your stdout (./program > output.file), there is no way how to remove contents of that file, even printf("\033[2J\033[1;1H"); just adds this sequence of characters into it.

提交回复
热议问题