Linux控制界面文字显示位置
2016-07-18 18:10
411 查看
如果编译不了,或许是因为Linux没有安装curses包
/* ============================================================================ Name : iconv.c Author : Version : Copyright : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <curses.h> int mian() { initscr();// 开始图形模式 noecho();// 不回显 char temp[128]; char s[128]; int seq = 0; while (scanf("%s", s)) { if (strcmp(s, "exit") == 0) break; clear();// 清除屏幕 sprintf(temp, "please input:"); mvaddstr(0, 0, temp);// 在指定的坐标打印 int i; for (i = 0; i < 10; i++) { sprintf(temp, "%s %d %s", s, seq++, s); mvaddrstr(i + 1, 0, temp); } move(0, 13);// 移动光标到指定坐标 refresh();// 刷新屏幕,如果不刷新屏幕,那么mvaddstr和move将不生效 } endwin();// 结束图形模式 return 0; }
相关文章推荐
- 我的linux菜鸟之路2
- RedHat Linux 手动设置IP及传送文件到远程主机
- linux动态链接库编译运行方法
- linux下java读取文件名乱码
- Linux远程桌面的选择
- zabbix安装与配置使用
- RedHat linux配置yum本地资源
- Bug系列------关于进程信号传递的competion
- Linux下字符集转换方法
- zentao(禅道)迁移
- Linux crontab计划任务
- linux中dig命令返回结果解释
- 【Linux】Jenkins配置和使用(二)
- windows与linux之间文件的传输方式总结
- 《Linux学习》之图形界面和字符界面的切换
- Linux使用SSH远程连接方式和更改密码 ,自己空间转移过来的。
- 《linux学习》之root权限的使用及退出
- linux添加开机启动脚本
- Linux(17)查看用户登陆历史的几个命令
- 远程连接linux数据库,连接不上,反馈慢,navicat报1065错误.