会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
积少成多
博客园
::
首页
::
博问
::
闪存
::
新随笔
::
联系
::
订阅
::
管理
::
公告
上一页
1
2
3
4
5
6
7
8
9
···
19
下一页
2017年4月16日
[测试]博客章节自动生成
摘要: http://www.cnblogs.com/wangqiguo/p/4355032.html 这是章节1 text1 这是章节1 text2 这是章节1 text3 阅读目录 章节1 章节2 章节3 章节4 阅读目录 章节1 章节2 章节3 章节4 一个好的博文除了博文的质量要好以外,好的组织结构
阅读全文
posted @ 2017-04-16 18:43 x7b5g
阅读(169)
评论(0)
推荐(0)
[转载]GCC 编译使用动态链接库和静态链接库--及先后顺序----及环境变量设置总结
摘要: 来自http://blog.csdn.net/benpaobagzb/article/details/51364005 GCC 编译使用动态链接库和静态链接库 1 库的分类 根据链接时期的不同,库又有静态库和动态库之分。 静态库是在链接阶段被链接的(好像是废话,但事实就是这样),所以生成的可执行文件
阅读全文
posted @ 2017-04-16 18:39 x7b5g
阅读(4263)
评论(0)
推荐(0)
2017年3月29日
二分查找树按照key值划分
摘要: #include <iostream>#include <vector>#include <algorithm>#include <string>#include <map>#include <set>#include <string.h>#include <stdio.h>#include <un
阅读全文
posted @ 2017-03-29 01:49 x7b5g
阅读(645)
评论(0)
推荐(0)
2016年12月20日
条款19:设计class犹如设计type
摘要: 1,新的type对象应该如何被创建和销毁? 这会影响class的构造函数ctor和析构函数dtor,以及内存分配函数和释放函数 //operator new //operator new[] //operator delete //operator delete[] 2,对象的初始化和对象的赋值该有
阅读全文
posted @ 2016-12-20 02:52 x7b5g
阅读(125)
评论(0)
推荐(0)
条款18 让接口容易使用,不易被误用
摘要: 这一节主要要告诉c++使用者,怎么对待接口(包括function 接口,class接口,template接口); 应该在设计接口的时候,就应考虑它的易用性,减少出错的可能。 考虑函数struct Foo* test();怎么使用智能指针减少资源泄漏的风险? 1,使用shared_ptr作为指针返回值
阅读全文
posted @ 2016-12-20 02:28 x7b5g
阅读(125)
评论(0)
推荐(0)
2016年10月31日
[两个指针]删除字符串中指定的字符
摘要: 删除字符串中指定的字符 输入 char *a = "abc123"; char *del = "a13"; 利用两个字符指针的方式,pslow,pfast; char *pslow,*pfast; 两个指针一开始都指向字符串的开始位置; pfast开始遍历字符串, if(*pfast==指定字符){
阅读全文
posted @ 2016-10-31 01:55 x7b5g
阅读(906)
评论(0)
推荐(0)
2016年9月28日
智能指针weak_ptr解决循环依赖问题
摘要: #include #include class Woman; class Man{ private: std::weak_ptr _wife; //std::shared_ptr _wife; public: void setWife(std::shared_ptr &woman){ _wife = woman; } v...
阅读全文
posted @ 2016-09-28 15:11 x7b5g
阅读(800)
评论(0)
推荐(0)
单例实现c++
摘要: #include <iostream> using namespace std; class Singleton { public: static Singleton *GetInstance() { if (m_Instance == NULL) { m_Instance = new Single
阅读全文
posted @ 2016-09-28 10:03 x7b5g
阅读(351)
评论(0)
推荐(0)
2016年9月19日
c++智能指针实现方式1
摘要: #include<iostream> using namespace std; // 定义仅由HasPtr类使用的U_Ptr类,用于封装使用计数和相关指针 // 这个类的所有成员都是private,我们不希望普通用户使用U_Ptr类,所以它没有任何public成员 // 将HasPtr类设置为友元,
阅读全文
posted @ 2016-09-19 12:01 x7b5g
阅读(632)
评论(0)
推荐(0)
2016年9月12日
c++中处理输入输出的方法
摘要: 怎么处理一行空格中的逗号, 使用c++的方法,可以这么处理: #include <sstream> #include<algorithm> using namespace std; 将数据放入string dataline中, replace(dataline.begin,dataline.end(
阅读全文
posted @ 2016-09-12 21:17 x7b5g
阅读(1832)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
19
下一页