上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要: #if 1 #include <iostream> #include <string> #include <cstdio> #include <cstdlib> #include <sstream> #include <iostream> #include <string> #include <vector> #include <list> #include <iostream> #include 阅读全文
posted @ 2019-08-11 10:31 白伟碧一些小心得 阅读(313) 评论(0) 推荐(0)
摘要: 一、string转化为数字 1.使用stoi 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 #include <iostream> #include <s 阅读全文
posted @ 2019-08-09 09:50 白伟碧一些小心得 阅读(631) 评论(0) 推荐(0)
摘要: unique_ptr: https://blog.csdn.net/afei__/article/details/80670283 最简单的智能指针实现: #include <numeric> #include <array> #include <cstring> #include <cstdio> 阅读全文
posted @ 2019-08-06 23:29 白伟碧一些小心得 阅读(406) 评论(0) 推荐(0)
摘要: &与&& 对于在C++中,大家对于符号“ & ”的第一映像是引用和取地址,对符号“ && ”的第一映像是逻辑与。但是在C++11中我们会看到下方这种表示方法: int &&k=i+k;1 对于第一眼见到上述的表达方式时,估计会一脸懵逼。下面对此做一个简述。 引用 & 是一个类型变量的别名。 通常使用 阅读全文
posted @ 2019-08-05 17:16 白伟碧一些小心得 阅读(693) 评论(0) 推荐(0)
摘要: C++ tuple类型: tuple是C++11新标准里的类型。它是一个类似pair类型的模板。pair类型是每个成员变量各自可以是任意类型,但是只能有俩个成员,而tuple与pair不同的是它可以有任意数量的成员。但是每个确定的tuple类型的成员数目是固定的。 1.tuple的简单使用 当我们希 阅读全文
posted @ 2019-08-05 10:39 白伟碧一些小心得 阅读(1057) 评论(0) 推荐(0)
摘要: #include #include #include #include #include #include #include #include #include //包装头文件 using namespace std; #if 0 //在C语言中 int main() { const int num = 100; //int a[num];//错误,num其实是... 阅读全文
posted @ 2019-08-04 20:20 白伟碧一些小心得 阅读(580) 评论(0) 推荐(0)
摘要: 具体可看:https://www.cnblogs.com/wangkeqin/p/9338358.html 模板元加速 阅读全文
posted @ 2019-08-04 19:30 白伟碧一些小心得 阅读(380) 评论(0) 推荐(0)
摘要: 例2: 阅读全文
posted @ 2019-08-04 18:11 白伟碧一些小心得 阅读(470) 评论(0) 推荐(0)
摘要: char(112312312);//不会检查是否超过范围,会截断 char{12345435345};//会报异常,异常如下: error C2397: 从“__int64”转换到“char”需要收缩转换 warning C4305: “初始化”: 从“__int64”到“char”截断warnin 阅读全文
posted @ 2019-08-04 16:13 白伟碧一些小心得 阅读(1697) 评论(0) 推荐(0)
摘要: C++ auto 关键字的使用 C++98 auto 早在C++98标准中就存在了auto关键字,那时的auto用于声明变量为自动变量,自动变量意为拥有自动的生命期,这是多余的,因为就算不使用auto声明,变量依旧拥有自动的生命期: int a =10 ; //拥有自动生命期 auto int b 阅读全文
posted @ 2019-08-04 12:22 白伟碧一些小心得 阅读(282) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页