随笔分类 -  c++容器

摘要:实验环境 linux mint 下 Qt 5.11 说白了,模板就是搭个函数,类的框架,具体实现的时候往里面填充内容,或者我们可以把类型名想作一个占位符号 函数模板 俗气的比大小 #include <iostream> #include<string.h> using namespace std; 阅读全文
posted @ 2020-02-01 00:56 saintdingtheGreat 阅读(169) 评论(0) 推荐(0)
摘要:基本用法 #include<iostream> #include<time.h> #include<vector> #include<list> using namespace std; void main() { int a[] = {33,44,55,66,77,88}; int i; list 阅读全文
posted @ 2019-12-27 14:58 saintdingtheGreat 阅读(695) 评论(0) 推荐(0)
摘要:初始化用法 #include <iostream> #include "string" using namespace std; void main() { string m1 = "陈培昌"; string m2("付高峰"); string m3 = m2; cout<<"m1:"<<m1<< 阅读全文
posted @ 2019-12-23 15:18 saintdingtheGreat 阅读(1289) 评论(0) 推荐(0)
摘要:基本用法 #include<iostream> #include<vector> using namespace std; void main() { vector<int> a(10,1);//初始化容器,开辟10个单位空间·元素初始化为1 int i; cout << "初始化变量" << en 阅读全文
posted @ 2019-12-23 10:56 saintdingtheGreat 阅读(2390) 评论(0) 推荐(0)