直接代码:代码段1: 1 #include 2 #include 3 #include 4 5 class some_class 6 { 7 public: 8 typedef void result_type; 9 void print_string(const ... Read More
posted @ 2014-05-07 20:13 仙人球球 Views(267) Comments(0) Diggs(0) Edit
第一部分源码为基础实践: 1 /*Beyond the C++ Standard Library ( An Introduction to Boost )[CN].chm*/ 2 /*bind的用法*/ 3 4 #include 5 #include 6 #include 7 #includ... Read More
posted @ 2014-05-07 16:05 仙人球球 Views(296) Comments(1) Diggs(0) Edit
注:在VS2010 UPDATE1下测试通过 1 /*测试functional的bind以及相关功能*/ 2 3 #include 4 #include 5 6 using namespace std; 7 using namespace std::placeholders; 8 9 in... Read More
posted @ 2014-05-06 17:55 仙人球球 Views(182) Comments(0) Diggs(0) Edit
1 /*测试enable_shared_from_this*/ 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 class TestClass : public enable_shared_fr... Read More
posted @ 2014-05-06 15:23 仙人球球 Views(222) Comments(0) Diggs(0) Edit
直接代码:注:编译环境VS2010 SP1 1 /*实现宽字节和窄字符转换以及中文文件的输入输出*/ 2 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 ... Read More
posted @ 2014-05-05 17:47 仙人球球 Views(1551) Comments(0) Diggs(0) Edit
使用com技术开发模式进行的示例。com技术关键部分源码:主要将所有接口都写入到这个文件中testinterface.h#ifndef TESTINTERFACE_H#define TESTINTERFACE_H#include //using namespace std;interface __d... Read More
posted @ 2014-05-05 17:43 仙人球球 Views(261) Comments(0) Diggs(0) Edit
1.实现boost库xml基本操作 2.解决boost对xml中中文乱码问题 3.实现普通字符串和宽字符串的傻瓜切换(模仿tchar.h) 4.代码运行环境为VS2010,需要导入boost库才能正常运行 5.VS2010运行时可能会发生错误。例如:cl.exe 或者 cvtres.exe 报错。 解决办法就是重新打开项目或者切换其它正常项目运行一下(反正我是这么解决的) Read More
posted @ 2014-05-03 02:14 仙人球球 Views(4136) Comments(1) Diggs(0) Edit
HuffmanCode.h 1 #ifndef HUFFMANCODE_H 2 #define HUFFMANCODE_H 3 4 enum LRSTATUS 5 { 6 LEFTCHILD, //左子树 7 RIGHTCHILD //右子树 8 }; 9 10 struct HuffmanCode11 {12 //哈弗曼编码类13 int weight; //权值14 int * pPath; //路径指针15 int pathLength; //路径长度16 HuffmanCode() //默认构造函数17 {18 ... Read More
posted @ 2013-06-25 22:07 仙人球球 Views(365) Comments(0) Diggs(0) Edit