摘要: #include #include #include #include #include #include #include #include #include #include #include "CSHOW.H"using namespace boost;using namespace std;extern int num;int main(){string command ; while(true){command.empty();cout " ;char ch;while( 0x0A != (ch =getchar()) ){command.insert( 阅读全文
posted @ 2013-07-01 21:08 Predator 阅读(263) 评论(0) 推荐(0) 编辑
摘要: #include #includeusing namespace std;// 方法指针的格式为:int (*ptr)(char *p) 即:返回值(指针名)(参数列表)typedef int (*CallBackFun)(char *p); // 为回调函数命名,类型命名为 CallBackFun,参数为char *p// 方法 Afun,格式符合 CallBackFun 的格式,因此可以看作是一个 CallBackFun int Afun(char *p){ printf("Afun 回调打印出字符%s!\n", p); return 0 ;}// 方法 Bfun,格式 阅读全文
posted @ 2013-07-01 21:07 Predator 阅读(858) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include using namespace boost;using namespace std;void main(){ vector vcLines; for (int i = 0; i ::iterator vcTem; for (vcTem = vcLines.begin(); vcTem != vcLines.end(); ++vcTem) { fs vcOutput; string line; ifstream ifile("E:\\line.txt"); while( 阅读全文
posted @ 2013-07-01 21:06 Predator 阅读(389) 评论(0) 推荐(0) 编辑
摘要: #include using namespace boost::posix_time;using namespace boost;class ReleaseResource{public: ReleaseResource(); ~ReleaseResource(); void DisplayMsg();private: char *m_szpString;};ReleaseResource::ReleaseResource(){ m_szpString = new char[40];}ReleaseResource::~ReleaseResource(){ if (m_szpString) . 阅读全文
posted @ 2013-07-01 21:05 Predator 阅读(436) 评论(0) 推荐(0) 编辑
摘要: #pragma onceclass CNumber{public: CNumber(void); CNumber(int total); ~CNumber(void); void ShowNumber(); int GetTotal();CNumber & operator = (const CNumber &number);public: int m_nTotal;};#include "Number.h"#include using namespace std;CNumber::CNumber(void){}CNumber::CNumber( int t 阅读全文
posted @ 2013-07-01 21:04 Predator 阅读(176) 评论(0) 推荐(0) 编辑
摘要: #include "Number.h"#include #include #include "Person.h"#include #include using namespace boost;using namespace std;void main(){ /*CNumber number1(20); CNumber number2; number2 = number1; cout pNumber(new CNumber(1000)); pNumber->ShowNumber(); boost::shared_ptr pInt(new int()) 阅读全文
posted @ 2013-07-01 21:02 Predator 阅读(412) 评论(0) 推荐(0) 编辑
摘要: #include "Number.h"#include #include #include "Person.h"#include #include using namespace boost;using namespace std;void main(){ boost::shared_array pArrayDatas(new int[20]); for (int i = 10; i > wait; return ; 阅读全文
posted @ 2013-07-01 21:00 Predator 阅读(1705) 评论(0) 推荐(0) 编辑
摘要: #includeusingnamespacestd;templateclassCOperation{public: COperation(Ta,Tb){this->m_a=a;this->m_b=b;} COperation(void){}; ~COperation(void){}; //加法 TAdd(Ta,Tb){returna+b;}; //减法 TSubtract(Ta,Tb){a-b;} private: Tm_a; Tm_b;}; voidmain(){ COperationintMy(100,10); cout>wait;} 阅读全文
posted @ 2013-07-01 20:57 Predator 阅读(239) 评论(0) 推荐(0) 编辑