C++ 提高教程 STL
行码阁119
这个作者很懒,什么都没留下…
展开
-
C++ 提高教程 STL queue容器(队列)
# include<iostream># include<queue># include<string># include<ctime>using namespace std;class Person{public: Person(int age, string name) { this->m_Age = age; this->m_Name = name; } int m_Age; str...原创 2021-10-14 11:23:48 · 94 阅读 · 0 评论 -
C++ 提高教程 STL stack容器
# include<iostream># include<stack>using namespace std;void test01(){ stack<int>s; s.push(10); s.push(20); s.push(30); s.push(40); while ((!s.empty())) { cout << "栈顶元素为:" << s.top() << endl; ...原创 2021-10-14 10:08:02 · 95 阅读 · 0 评论 -
C++ 提高教程 STL-评委打分
# include<iostream># include<string># include<vector># include<deque># include<algorithm># include<ctime>using namespace std;class Person{public: Person(string name, int ascore) { this->m_Name = na...原创 2021-10-14 09:49:43 · 111 阅读 · 0 评论 -
C++ 提高教程 STL deque -大小操作 和 插入和删除
一、大小操作# include<iostream>#include<deque># include<algorithm># include<string>using namespace std;void printVector(const deque<int>& v) //容器中的数不可以需改{ for (deque<int>::const_iterator it = v.begin(); it..原创 2021-10-14 09:49:59 · 141 阅读 · 0 评论 -
C++ 提高教程 STL deque容器-赋值操作
代码简单# include<iostream>#include<deque># include<algorithm># include<string>using namespace std;void printVector(const deque<int>& v) //容器中的数不可以需改{ for (deque<int>::const_iterator it = v.begin(); it != v...原创 2021-10-13 11:30:02 · 152 阅读 · 0 评论 -
C++ 提高教程 STL Vector容器 -构造函数
# include<iostream>#include<deque># include<algorithm># include<string>using namespace std;void printVector(const deque<int>& v) //容器中的数不可以需改{ for (deque<int>::const_iterator it = v.begin(); it...原创 2021-10-13 11:23:31 · 116 阅读 · 0 评论 -
C++ 提高教程 STL vector容器-预留空间
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout &l...原创 2021-10-13 11:05:51 · 187 阅读 · 0 评论 -
C++ 提高教程 STL Vector互换容器
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout <&...原创 2021-10-13 10:54:04 · 157 阅读 · 0 评论 -
C++ 提高教程 STL vector容器-数据存取
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout <&...原创 2021-10-13 10:25:55 · 109 阅读 · 0 评论 -
C++ 提高教程 STLvector容器插入和删除
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout &l...原创 2021-10-13 10:16:52 · 177 阅读 · 0 评论 -
C++ 提高教程 STL vector容量-vector容量和大小
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout &l...原创 2021-10-13 10:06:39 · 193 阅读 · 0 评论 -
C++ 提高教程 STL --vector容器-赋值操作
# include<iostream>#include<vector># include<algorithm># include<string>using namespace std;void printVector(vector<int>& v){ for (vector<int>::iterator it = v.begin(); it != v.end(); it++) { cout &l...原创 2021-10-13 09:56:25 · 257 阅读 · 0 评论 -
C++ 提高教程 STL - Vector容器嵌套容器
# include<iostream># include<vector>using namespace std;//容器中嵌套容器void test01(){ vector<vector<int>> v; //先创建小容器 vector<int> v1; vector<int> v2; vector<int> v3; vector<int> v4; vector<in...原创 2021-10-12 10:26:39 · 237 阅读 · 0 评论 -
C++ 提高教程 STL -Vector存放自定义数据类型
# include<iostream># include<vector># include<algorithm># include<string>using namespace std;//Vector存放自定义数据类型class Person{public: Person(string name, int age) { this->m_Name = name; this->m_Age=age; } stri...原创 2021-10-12 09:37:22 · 168 阅读 · 0 评论 -
C++ 提高教程 STL -容器算法迭代器初识
1 第一种遍历方式 vector<int>::iterator itBegin = v.begin(); //起始迭代器,指向容器中的第一个元素 vector<int>::iterator itEnd = v.end();//结束迭代器 指向容器中最后一个元素的下一个位置 //第一种遍历方式: while (itBegin != itEnd) { cout << *itBegin << endl; itBegin++;...原创 2021-10-11 23:04:14 · 129 阅读 · 0 评论 -
C++ 提高教程 STL初识
原创 2021-10-11 20:04:28 · 75 阅读 · 0 评论