随笔分类 -  STL

学习STL中的日常笔记
摘要:#include<iostream> #include<map> #include<algorithm> using namespace std; void func(pair<int, char> t) { cout << "key: " << t.first << " value: " << t 阅读全文
posted @ 2018-10-03 15:17 清浅...忆回 阅读(74) 评论(0) 推荐(0)
摘要:#include<iostream> #include<algorithm> #include<list> using namespace std; struct Node { char a; int b; }; void func(Node &t) { cout << t.a << " " << 阅读全文
posted @ 2018-10-02 17:05 清浅...忆回 阅读(146) 评论(0) 推荐(0)
摘要:#include<iostream> #include<vector> using namespace std; struct STU { int a; }; int main() { vector<int> vec1; //vector 中的结构可以是C C++所有的基础类型 vector<cha 阅读全文
posted @ 2018-09-18 21:49 清浅...忆回 阅读(101) 评论(0) 推荐(0)
摘要:#include<iostream> #include<string> using namespace std; int main() { //string构造函数 string str1; cout << str1.c_str() << endl; //c_str 返回一个const char * 阅读全文
posted @ 2018-09-09 20:15 清浅...忆回 阅读(91) 评论(0) 推荐(0)