摘要: deque deq; for (int i = 0; i < 20; ++i) { deq.push_back(i); } for (int j = 0; j < 20; ++j) { int tem = deq.back(); cout << tem << " " ; deq.pop_back(); //cout << deq[j] << " "; } cout << endl; cout << "双端队列中元素总数:" << deq.s 阅读全文
posted @ 2013-07-06 12:42 Predator 阅读(1903) 评论(0) 推荐(0) 编辑
摘要: #include #include #include "TestFunction.h"#include #include using namespace std;//using ::testing::InitGoogleTest;using namespace testing;#pragma comment(lib, "gtestd.lib")void main(int argc, char **argv){ /*priority_queue pqe; pqe.push(10); pqe.push(15); pqe.push(18); pqe.push( 阅读全文
posted @ 2013-07-06 12:41 Predator 阅读(223) 评论(0) 推荐(0) 编辑
摘要: #include #include #include "TestFunction.h"#include using namespace std;//using ::testing::InitGoogleTest;using namespace testing;#pragma comment(lib, "gtestd.lib")void main(int argc, char **argv){ /*cout > total; SeekScore(total); int wait; cin >> wait;*/ //GTEST_FLAG(o 阅读全文
posted @ 2013-07-06 12:40 Predator 阅读(486) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class TTest{public: void (TTest::*pfun)(void); void test(); void fun(void);};void TTest::fun(){ cout *pfun)(); }int main(){ TTest* t=new TTest(); t->fun(); t->test(); delete t; int wait; cin >> wait; return 0;} 阅读全文
posted @ 2013-07-06 12:39 Predator 阅读(154) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace boost;using namespace std;class Bridge{public: class Person; Bridge(); ~Bridge(); void ShowMsg();private: boost::shared_ptr m_person;};class Bridge::Person{public: Person(); ~Person(); void ShowMsg();};void Bridge::ShowMsg(){ this->m_person->ShowMsg();}Bridge: 阅读全文
posted @ 2013-07-06 12:38 Predator 阅读(260) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace boost;using namespace std;void main(){ boost::shared_ptr p = boost::make_shared(14); cout other = p; cout > wait;} 阅读全文
posted @ 2013-07-06 12:37 Predator 阅读(982) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace boost;using namespace std;class Person{public: Person(){} Person(string name, int age){this->m_strName = name; this->m_nAge = age;} ~Person(){} void DisplayMsg(){cout m_strName m_nAge m_strName = name; this->m_nAge = age;}private: string m_strName; 阅读全文
posted @ 2013-07-06 12:36 Predator 阅读(780) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace boost;using namespace std;class Person{public: Person(){} Person(string name, int age){this->m_strName = name; this->m_nAge = age;} ~Person(){} void DisplayMsg(){cout m_strName m_nAge m_strName = name; this->m_nAge = age;}private: string m_strName; int m_nA 阅读全文
posted @ 2013-07-06 12:35 Predator 阅读(489) 评论(0) 推荐(0) 编辑
摘要: #include#include #include #include using namespace boost;using namespace std;void main(){ srand(time(0)); int tem; for (int i = 0; i > wait;}#include#include #include #include int RandBetween(int a, int b) { int result; result = a + rand() % ( b - a + 1); return result;}using namespace boost;usin 阅读全文
posted @ 2013-07-06 12:34 Predator 阅读(219) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include using namespace std;#include using namespace boost::filesystem;using namespace boost;int _tmain(int argc, _TCHAR* argv[]){ namespace fs = boost::filesystem; // 路径处理 path myPath("D:/boost_1_53_0/build_boost_1_53_0.bat"); string res; res = myPath.string( 阅读全文
posted @ 2013-07-06 12:33 Predator 阅读(548) 评论(0) 推荐(0) 编辑
摘要: C++ map的基本操作和使用(2009-09-23 14:58:21)标签: cmap编程基本操作livehaiit 分类: Pro.LanguagesMap是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作!1. map最基本的构造函数;mapmapstring; mapmapint;mapmapstring; mapmapchar;mapmapchar; mapmapint;2. map添加数据;map maplive;1.maplive.insert(pair(102,"aclive" 阅读全文
posted @ 2013-07-06 12:29 Predator 阅读(254) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;class CPerson{public: CPerson(){} ~CPerson(){} virtual void Walk(){cout Walk();/// manager = new CPerson; //注意这里报错 int wait; cin >> wait;} 阅读全文
posted @ 2013-07-06 12:27 Predator 阅读(261) 评论(0) 推荐(0) 编辑