会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
喵小喵~
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
28
29
30
31
32
33
34
35
36
···
68
下一页
2018年3月14日
60.左值右值以及类型判断
摘要: 前提是要包含头文件 判断是否是左值引用 是否是右值引用 是否是数组 是否是一个整数 是否是一个类 1 check(1, 10); 2 int i(10); 3 int &ri(i); 4 int &&rri(i + 3); 5 //判断是否是左值引用 0不是 1是 6 cout << is_lval
阅读全文
posted @ 2018-03-14 14:27 喵小喵~
阅读(235)
评论(0)
推荐(0)
2018年3月13日
59.C++与正则表达式
摘要: regex_match 整个字符串是否匹配 (通过cmatch存储匹配的结果),match[0]代表整个匹配序列,match[1]代表第1个匹配后的子序列,match[2]代表第2个匹配后的子序列 代码示例: regex_search 整个字符串进行查找判断是否含有指定数据类型 regex_repl
阅读全文
posted @ 2018-03-13 23:36 喵小喵~
阅读(285)
评论(0)
推荐(0)
58.最全正则表达式教程,最好正则表达式教程
摘要: 正则表达式是什么? 字符是计算机软件处理文字最基本的单位,可以是字母,也可以是数字,标点符号,空格,换行符,汉字等等. 字符串是0个或更多个字符的序列.文本也就是文字,字符串.说某个字符串匹配某个正则表达式,通常是指这个字符串里有一部分(或几部分分别)能满足表达式给出的条件. 我们在处理字符串的程序
阅读全文
posted @ 2018-03-13 18:09 喵小喵~
阅读(466)
评论(0)
推荐(0)
57.C++处理转义字符
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 7 8 void main() 9 { 10 //string str("\"C:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQScLauncher.exe\""); 11 //\n不会换行,...
阅读全文
posted @ 2018-03-13 12:17 喵小喵~
阅读(1155)
评论(0)
推荐(0)
56.lambda表达式与绑定以及伪函数和绑定
摘要: 1 #include 2 #include 3 using namespace std; 4 using namespace std::placeholders; 5 6 int add(int a, int b) 7 { 8 return a + b; 9 } 10 11 class myclass 12 { 13 public: 14 int ope...
阅读全文
posted @ 2018-03-13 12:01 喵小喵~
阅读(166)
评论(0)
推荐(0)
2018年3月12日
55.函数模板指针匹配(模板自动匹配*多的)
摘要: 1 #include 2 using namespace std; 3 4 //模板自动匹配*多的 5 template 6 void com(T *p) 7 { 8 cout 13 void com(T **p) 14 { 15 cout << "**" << endl; 16 cout << typeid(T).name() << endl; ...
阅读全文
posted @ 2018-03-12 23:55 喵小喵~
阅读(183)
评论(0)
推荐(0)
54.函数模板默认参数
摘要: 1 #include 2 using namespace std; 3 4 //模板可以设置有默认值 5 template 6 void hello(T str) 7 { 8 cout 14 void show(T1 t1 = 1, T2 t2 = 2, T3 t3 = 3) 15 { 16 cout ("hello"); 24 show(); 2...
阅读全文
posted @ 2018-03-12 23:51 喵小喵~
阅读(170)
评论(0)
推荐(0)
53.伪函数与函数绑定器
摘要: 1 #include 2 #include 3 using namespace std; 4 using namespace std::placeholders; 5 6 class myclass 7 { 8 public: 9 void add1(int a) 10 { 11 cout << a << endl; 12 } 13...
阅读全文
posted @ 2018-03-12 23:44 喵小喵~
阅读(116)
评论(0)
推荐(0)
52.模板的重载
摘要: 1 #include 2 using namespace std; 3 4 template 5 void go(T t1) 6 { 7 cout 11 void go(T *t1) 12 { 13 cout << "******" << endl; 14 } 15 16 void main() 17 { 18 int *p = new int[2]...
阅读全文
posted @ 2018-03-12 23:28 喵小喵~
阅读(93)
评论(0)
推荐(0)
51.模板与引用
摘要: 1 #include 2 using namespace std; 3 4 //ref 在模板中变量转化为引用 5 //move 左值引用转化为右值引用 6 //副本,不能改变数据 7 template 8 void print1(T t) 9 { 10 t += 1; 11 cout 15 void print2(T &t) 16 { 17 t...
阅读全文
posted @ 2018-03-12 23:24 喵小喵~
阅读(124)
评论(0)
推荐(0)
上一页
1
···
28
29
30
31
32
33
34
35
36
···
68
下一页
公告