简体   繁体   English

c中的清除终端

[英]Clear terminal in c

I am facing problem to understand this line of code.我在理解这行代码时遇到了问题。

printf("\033[2J\033[1;1H");

This printf statement is used to clear the terminal in c.此 printf 语句用于清除 c 中的终端。 Can anybody explain this to me?有人可以向我解释一下吗?

Thanks.谢谢。

Take a look at the list of ANSI escape sequences:看看 ANSI 转义序列列表:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797

ESC[2J : erases the entire screen ESC[2J : 擦除整个屏幕

General information:一般信息:
https://en.wikipedia.org/wiki/ANSI_escape_code https://en.wikipedia.org/wiki/ANSI_escape_code

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM