会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
一万年太久
积跬步至千里;行而不辍,履践致远。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
56
下一页
2024年10月3日
C++ 向顺序容器添加容器
摘要: ▲ 《C++ Primer》 P305
阅读全文
posted @ 2024-10-03 13:37 double64
阅读(15)
评论(0)
推荐(0)
2024年9月29日
C++ const_cast 和重载
摘要: 在4.11.3节(第145页)中我们说过,const_cast 在重载函数的情景中最有用。举个例子,回忆6.3.2节(第201页)的shorterstring 函数: //比较两个string对象的长度,返回较短的那个引用 const string &shorterString(const stri
阅读全文
posted @ 2024-09-29 15:51 double64
阅读(25)
评论(0)
推荐(0)
2024年9月27日
C++ 容器赋值运算符
摘要: ▲ 《C++ Primer》 P302 assign list<string> names; vector<const char *> old_c_str{ "娃哈哈", "孟菲斯", "Hello Wold!" }; names.assign(old_c_str.cbegin(), old_c_s
阅读全文
posted @ 2024-09-27 22:09 double64
阅读(11)
评论(0)
推荐(0)
2024年9月26日
C++ 容器定义和初始化
摘要: ▲ 《C++ Primer》 P299
阅读全文
posted @ 2024-09-26 08:07 double64
阅读(16)
评论(0)
推荐(0)
C++ 容器操作
摘要: ▲ 容器操作 《C++ Primer》 P295
阅读全文
posted @ 2024-09-26 07:59 double64
阅读(19)
评论(0)
推荐(0)
C++ 顺序容器类型
摘要: ▲ 顺序容器类型 《C++ Primer》 P294
阅读全文
posted @ 2024-09-26 07:37 double64
阅读(15)
评论(0)
推荐(0)
2024年9月24日
C++ IO 类
摘要: IO 库: istream(输入流)类型,提供输入操作。 ostream(输出流)类型,提供输出操作。 cin,一个istream对象,从标准输入读取数据。 cout,一个ostream对象,向标准输出写入数据。 cerr,一个ostream对象,通常用于输出程序错误消息,写入到标准错误。 >>运算
阅读全文
posted @ 2024-09-24 23:02 double64
阅读(29)
评论(0)
推荐(0)
2024年9月22日
C++ const void * 类型转换各种类型转换简单测试
摘要: 这样转化是没有问题的。 int a{ 100 }; const void *p = &a; const int *pi = static_cast<const int *>(p); cout << *pi << endl; 输出: 100 void * 转换貌似原来什么类型,再强转回去没啥问题,动态
阅读全文
posted @ 2024-09-22 23:54 double64
阅读(194)
评论(0)
推荐(0)
C++ 列表初始化 {},类内初始化只能=或{}的形式
摘要: 花括号的形式{},进行列表初始化,在C++11中初始化变量到了全面的应用。 可参看《C++ Primer》 P39 P76 P88 等相关内容信息。 Note: 当我们提供一个类内初始值时,必须以符号=或者花括号表示。《C++ Primer》 P246。 如下: class Dog { public
阅读全文
posted @ 2024-09-22 23:13 double64
阅读(31)
评论(0)
推荐(0)
C++ 线程池
摘要: #include <iostream> #include <string> #include <memory> #include <vector> #include <thread> #include <queue> #include <functional> #include <mutex> us
阅读全文
posted @ 2024-09-22 14:38 double64
阅读(28)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
56
下一页
公告