Cygwin中使用ncurses库
2015-06-20 23:53
323 查看
首先安装Cygwin的完整包,这个包有7GB大小左右
之后使用这个小例子测试是否成功
编译指令是:
可以看到编译成功了
之后使用这个小例子测试是否成功
#include <ncurses.h> #include <string> #include <vector> //#define DEBUG #ifdef DEBUG #include <iostream> #include <cstdio> #endif int main(void) { int x,y; std::vector<std::string> msg; msg.push_back("Hello Ncurses!"); msg.push_back("Please Enter Anykey to exit. . ."); std::vector<std::string>::iterator pa=msg.begin(); #ifndef DEBUG initscr(); curs_set(0); noecho(); getmaxyx(stdscr,y,x); //refresh(); //mvprintw(y/2,x/2-pa->size()/2,pa->c_str()); for(int i=0;pa!=msg.end();++pa,++i) mvprintw(y/2+i,x/2-pa->size()/2,pa->c_str()); //refresh(); getch(); echo(); curs_set(1); endwin(); #else printf("%s\n",(++pa)->c_str()); std::cout<<*pa<<std::endl; #endif return 0; }
编译指令是:
可以看到编译成功了
相关文章推荐
- VS高亮显示无扩展名源码文件
- 为什么基类中的析构函数要声明为虚析构函数?
- Fragment管理的工具类
- 最大自序和问题
- java基础—IO流——将一些字符写入到指定硬盘上的目录中去:
- 最大自序和问题
- python3.3:文本文件读取、处理及保存。小练习
- fatal error C1189: #error : missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
- Struts2获取Web容器资源的方式 访问request,session
- 2015062010 - 英雄
- 运行及总结
- 《梦断代码》第一篇总结
- 课本最后一章及博客读后感
- 15HD_OJ——FatMouse's Speed
- 图书馆管理系统运行及总结
- 测试与调试
- BP神经网络推导过程详解
- 布尔表达式的验证
- 2015062009 - 端午祭
- jQuery序列化Ajax提交表单