Hi everyone
I got this line of code.
printf ("\033[2J\033[1;1H");
My program is working with rs232 terminal.
Can someone help me understand what does this line do?
I know it clears the screen.. but how exactly?
Thanks!
Hi everyone
I got this line of code.
printf ("\033[2J\033[1;1H");
My program is working with rs232 terminal.
Can someone help me understand what does this line do?
I know it clears the screen.. but how exactly?
Thanks!
\033 is an octal escape sequence, which evaluates to the ESC character code (decimal 27)
The \033[ pair is known as a CSI
ANSI escape code - Wikipedia, the free encyclopedia
You need a terminal which understands these sequences if you want to observe the intended effects, otherwise you just see random garbage printed on screen.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.