#include <stdio.h>
int main()
{
printf("asd");
char code[4] = { 0x08 , 0x1b , 0x5b ,0x4b } ;
int i = 0 ;
while ( i < 4 )
{
putc(code[i], stdout);
i++;
}
printf("\n");
return 0;
}
输出:
[root@localhost ~]# ./a.out
作为
[root@localhost ~]#
似乎代码“0x08”将终端光标向左移动到字母“d”的位置,而“0x1b、0x5b、0x4b”清除了字母“d”。 我想知道一些代码的含义,例如 { 0x08 , 0x1b , 0x5b ,0x4b } 。有相关资料吗?
谢谢。
最佳答案
关于c - 如何用 ASCII 码移动终端光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24628094/