上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 68 下一页
摘要: 前提是要包含头文件 判断是否是左值引用 是否是右值引用 是否是数组 是否是一个整数 是否是一个类 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 喵小喵~ 阅读(229) 评论(0) 推荐(0) 编辑
摘要: regex_match 整个字符串是否匹配 (通过cmatch存储匹配的结果),match[0]代表整个匹配序列,match[1]代表第1个匹配后的子序列,match[2]代表第2个匹配后的子序列 代码示例: regex_search 整个字符串进行查找判断是否含有指定数据类型 regex_repl 阅读全文
posted @ 2018-03-13 23:36 喵小喵~ 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 正则表达式是什么? 字符是计算机软件处理文字最基本的单位,可以是字母,也可以是数字,标点符号,空格,换行符,汉字等等. 字符串是0个或更多个字符的序列.文本也就是文字,字符串.说某个字符串匹配某个正则表达式,通常是指这个字符串里有一部分(或几部分分别)能满足表达式给出的条件. 我们在处理字符串的程序 阅读全文
posted @ 2018-03-13 18:09 喵小喵~ 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(1131) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 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 喵小喵~ 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 68 下一页