摘要: #include//标准输入输出流usingnamespacestd;//标准命名空间 constintCMP_LES=-1;//定义的常量constintCMP_EQU=0;constintCMP_BIG=1; classComparer//仿函数的类函数的主要功能是重载运算符()这样调用的时候就直接用类引用加上()后面的参数就可以{public: Comparer(intcmpType) { m_cmpType=cmpType;//初始化变量 } booloperator()(intnum1,intnum2)const { boolres; switch(m_cmpType) {... 阅读全文
posted @ 2013-07-09 21:25 Predator 阅读(360) 评论(0) 推荐(0) 编辑
摘要: // mysqlTest.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include #include #include using namespace std;class Person{public: Person(string name){this->m_name = name;} void Display(){cout Display();}int _tmain(int argc, _TCHAR* argv[]){ Test test; test.DisplayIn() 阅读全文
posted @ 2013-07-09 19:54 Predator 阅读(838) 评论(0) 推荐(0) 编辑
摘要: char c2[20] = "ganquanfu"; char c1[256]; c1[sizeof(c1)-1] = 0; _snprintf(c1, sizeof(c1), "%s", c2); if(c1[sizeof(c1)-1]!=0) { cout << "warning: string is truncated" <<endl; c1[sizeof(c1)-1]=0; } cout << c1 << endl; 阅读全文
posted @ 2013-07-09 19:52 Predator 阅读(1137) 评论(0) 推荐(0) 编辑
摘要: // mysqlTest.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ CMRDBIO myDb(DBTYPE::DB_MYSQL);// string strSQL ; //strSQL = "insert into person values('dfsdf', 24) "; //cout GetRecordCoun 阅读全文
posted @ 2013-07-09 19:51 Predator 阅读(395) 评论(0) 推荐(0) 编辑
摘要: #pragma once#include "persistable.h"#include "memento.h"#include#include using namespace std;class CFGStudent:public xml_api::Persistable{public: CFGStudent(void); ~CFGStudent(void);public: virtual bool SaveState(xml_api::Memento* m); // 读取配置 virtual bool LoadState(xml_api::Memen 阅读全文
posted @ 2013-07-09 19:48 Predator 阅读(2281) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include "FGConfig.h"#include "Utils.h"#include "persistable.h"#include #include using namespace std;using namespace xml_api;#include inline void EnableMemLeakCheck(){ _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_D 阅读全文
posted @ 2013-07-09 19:47 Predator 阅读(292) 评论(0) 推荐(0) 编辑
摘要: //xmlTest.cpp:定义控制台应用程序的入口点。// #include"stdafx.h"#include"FGConfig.h"#include"Utils.h"#include"persistable.h"#include#include#include#includeusingnamespaceboost; usingnamespacestd;usingnamespacexml_api; classPerson{public: Person(){} Person(stringname):m_strNa 阅读全文
posted @ 2013-07-09 19:45 Predator 阅读(2251) 评论(0) 推荐(0) 编辑