简体   繁体   中英

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. Can anybody explain this to me?

Thanks.

Take a look at the list of ANSI escape sequences:
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797

ESC[2J : erases the entire screen

General information:
https://en.wikipedia.org/wiki/ANSI_escape_code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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