摘要:
list.front(); //返回第一个元素 list.back(); //返回最后一个元素 1 #include <iostream> 2 #include <list> 3 4 using namespace std; 5 6 int main() 7 { 8 int num[] = { 11 阅读全文
摘要:
list.assign(beg, end); //将[beg, end)区间中的数据拷贝赋值给本身 1 #include <iostream> 2 #include <list> 3 4 using namespace std; 5 6 int main() 7 { 8 int num[] = { 阅读全文
摘要:
ist.size(); //返回容器中元素的个数 1 #include <iostream> 2 #include <list> 3 4 using namespace std; 5 6 int main() 7 { 8 int num[] = { 111,222,333,444,555 }; 9 阅读全文
摘要:
push_back(elem); //在容器尾部加入一个元素 1 #include <iostream> 2 #include <list> 3 4 using namespace std; 5 6 int main() 7 { 8 int num[] = { 111,222,333 }; 9 li 阅读全文
摘要:
list<T> lstT —— list 对象的默认构造 list 与 vector 一样,同样采用模板类实现,对象的默认构造形式:list<T> lstT 如: 1 #include <iostream> 2 #include <list> 3 4 using namespace std; 5 6 阅读全文