自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

DLililiDengDaa~~

I don't wanna be a big man,Just wanna fight with everyone else!

  • 博客(9)
  • 资源 (1)
  • 收藏
  • 关注

原创 c++ primer 13.3节练习(定义自己版本的swap函数并排序)

13.31#include #include #include #include #include #include "StrBlob.h"#include "StrBlobPtr.h"using namespace std;class HashPtr{ friend void swap(HashPtr&, HashPtr&);public: HashPtr(const

2017-12-06 15:33:35 507

原创 c++ primer 13.1.4节练习(合成的拷贝构造函数与自定义拷贝函数区别)

13.1.4节练习目的:Numbered类使每个对象都有唯一的标号情况1:使用合成的拷贝构造函数#include #include #include #include using namespace std;class Numbered{public: Numbered(){ mySeq = num++; }//构造函数 int mySeq; //Numbere

2017-12-04 16:27:41 593

原创 c++ primer 13.13练习(构造,拷贝,析构函数何时发生详解)

13.13理解构造函数,拷贝构造函数,析构函数何时发生,最简单的一个办法就是写一个很简单的类,观察在几个情况下是否发生。#include #include #include #include using namespace std;struct Test{ Test(){ cout << "构造函数" << endl; } Test(const Test &){ cou

2017-12-04 15:14:49 379

原创 c++ primer 12.2.2节练习(使用allocate五步走)

12.26#include #include #include using namespace std;int main(){ /**********1.定义allocator的一个allocator对象,要有类型T********/ allocator alloc; int n = 100; /**********2.allocate(n)分配n个为初始化的内存***

2017-12-03 15:57:42 414

原创 c++ Primer 5 12.1.6节练习 (头文件相互包含的问题及解决办法)

头文件相互包含的解决办法

2017-12-01 16:51:04 383

原创 C++ primer 8.3.2节练习(有关ostringstream清空的问题)

8.13输入:电话本输出:检测后并格式化后的电话本,输出错误电话号码#include #include #include #include using namespace std;bool Valid(const string& i){ return(i.size() == 9);}string& Format(string& i){ for (auto

2017-12-01 15:33:50 593

原创 c++ primer 8.2.1节练习(读文件 写文件 fstream)

8.4#include #include #include #include using namespace std;int main(){ ifstream input("F:\\test\\input.txt");//打开文档,string中有'\'应用转义双写 vector Test{}; string temp1; if (getline(input, te

2017-12-01 13:25:28 409

原创 c++ primer 8.1.2节练习(关于流的知识)

8.1#include #include using namespace std;istream & Process(istream & i)//对于流对象,不能拷贝和赋值,必须使用引用来传递实参{ int test; while (i >> test||!i.eof()) { if (i.bad()) throw runtime_error("IO流发生不可恢

2017-12-01 13:21:24 605

原创 c++ primer 12.1.4节练习(自定义 shared_ptr的删除器)

12.14#include #include #include #include using namespace std;string destination = "目的";string connection = "连接";string Connect(string *) //获得一个连接{ cout << "获得一个连接" << endl; string temp

2017-12-01 13:17:23 322

Unix-Linux编程实践教程

学习Linux的教程,高清版本。对新手较为友好,可以入门学习。

2018-09-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除