Tag: C/C++
All the articles with the tag "C/C++".
windows std cout设置输出颜色
Published: at 02:25 PM包含头文件ConsoleColor.h stdcout << red << "this text is read" << stdendl; stdcout << green << "this text is green" << stdendl; // ConsoleColor.h pragma once include <iostream> include <windows.h> inline stdostream& blue(...
log4cxx编译、使用
Published: at 02:22 PM1. 下载下面三个文件放在同级目录下解压: http//apr.apache.org/download.cgi apr-1.4.6-win32-src.zip apr-util-1.5.1-win32-src.zip http//logging.apache.org/log4cxx/download.html apache-log4cxx-0.10.0.zip 2. 将apr-1.4.6改名为apr 将apr-util-1...
boost xml
Published: at 02:02 PM读写XML文件: testConfigRead.xml <?xml version="1.0" encoding="GB2312"?> <content> <title value="xxxx"/> <number>1234</number> <groups> <class num="1" type="type1"/> <class num="2" type="type2"/> <class num="3" type="type3"...
表达式求值——栈
Published: at 01:57 PMinclude <iostream> include <stack> include <cctype> / 获取优先级符号,flag数组优先级关系是根据oper得来的,所以它们中元素的顺序不能轻易改变 @param ain 先前的运算符 @param bin 之后的运算符 @return 成功返回运算符,失败返回空格字符 ...
STL进阶
Published: at 01:51 PMSTL组件 打印容器内的所有元素 stdcopy(vi1.begin(),vi1.end(), stdostreamiterator<int>(stdcout, ", ")); sort排序 struct comp { bool operator()(int x, int y) const // 由大到小 { return x>y; } }; ...
当年的毕业设计 - MFC信息管理系统
Published: at 01:44 PM由于程序只能在远程服务器上跑,调试起来非常麻烦,所以想弄一个UDP的日志服务程序,能实时的显示远程程序打印过来的日志。于是就想到了用MFC弄一个继承自CListView的单文档应用程序。 话说MFC还是我大学时候做毕业设计时用过, 距离现在都两年了,好多API也忘得差不多了。不...
模拟glib中双链表的部分实现
Published: at 01:39 PM// GList.h ifndef GLISTHINCLUDED define GLISTHINCLUDED ifdef cplusplus extern "C" { endif typedef struct GList GList; struct GList { void data; GList next; GList prev; }; typedef void (GFunc)(void data, voi...
STL 什么时候用哪种容器
Published: at 01:35 PMSTL 什么时候用哪种容器(http//hi.csdn.net/attachment/201202/12/86059811329056420L5o2.png) As a supplement to the table, the following rules of thumb might help By default, you should use a vector. It has the simplest internal data structur...
头文件宏定义
Published: at 01:34 PM/ Guard C code in headers, while including them from C++ / ifdef cplusplus define GBEGINDECLS extern "C" { define GENDDECLS } else define GBEGINDECLS define GENDDECLS endif ifndef NULL ifdef cplusplus define...
C++读写XML文件(Libxml2库)
Published: at 01:32 PMC++程序有时候要读写XML文件, 这里介绍一个读写XML文件的库——Libxml2。 主页:http//xmlsoft.org/index.html(http//xmlsoft.org/index.html) 入门教程很详细的:http//jianlee.ylinux.org/Computer/C/libxml.htmlsec11(http//jianlee.ylinux.org/Computer/C/...