Chinaunix首页 | 论坛 | 博客
  • 博客访问: 427165
  • 博文数量: 184
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 594
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-17 16:24
个人简介

我是一只小小鸟

文章分类

全部博文(184)

文章存档

2016年(1)

2015年(55)

2014年(127)

2013年(1)

分类: C/C++

2014-03-25 14:08:27


				
 #include <> 
 
 int system(const char *string);
使用方法
system("clear");
system("date");

点击(此处)折叠或打开

  1. #include<stdio.h>
  2. #include<stdlib.h>

  3. int system(const char *string);
  4. int main(void)
  5. {
  6.     system("clear");
  7.     system("date");
  8.     printf("This is my first program!\n");
  9.     system("sleep 2\n");
  10.  
  11.     return 0;
  12. }
[root@localhost program.c]# gcc test1.c -Wall -o test1                ^C
[root@localhost program.c]# ./test1                          
Sat Jun 21 20:17:10 CST 2014
This is my first program!(2s后)
[root@localhost program.c]#

2  shell终端的清屏指令有:
# printf "\033c"
#clear

#tput clear


阅读(657) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~