QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1463|回复: 3

clear源代码,有人能解释吗?

[复制链接]
发表于 2003-11-11 12:22:33 | 显示全部楼层 |阅读模式
#include <linux/unistd.h>

int main(void)
{
       write("\033[1;1H\033[2J",10);

        return 0;
}
发表于 2003-11-11 12:45:29 | 显示全部楼层
"\033[1;1H\033[2J" is called a escape secquence. as old terminals are connected through serial cable which can only transmit ASCII codes.
special controls such as clear screen is sent though a escape secquence.(a esc key(27) followed by secquence of ASCII code .
回复

使用道具 举报

 楼主| 发表于 2003-11-11 13:13:54 | 显示全部楼层
谢谢!!!!
回复

使用道具 举报

发表于 2003-11-11 17:47:01 | 显示全部楼层
i can not read any of them,i think i must study hard and learn more!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-16 07:20 , Processed in 0.039484 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表