c++ stl 学习
2016-07-09 17:05
302 查看
***************************STL list 类学习 *******************************
// cplus_list_test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <list>
//using namespace std;
int main(int argc, char* argv[])
{
list<string>::iterator MilkshakeIterator;
list<string> Milkshakes;
Milkshakes.push_back("Chocolate");
Milkshakes.push_back("Strawberry");
Milkshakes.push_front("Lime");
Milkshakes.push_front("Vanilla");
for (MilkshakeIterator = Milkshakes.begin(); MilkshakeIterator != Milkshakes.end(); ++MilkshakeIterator)
cout << *MilkshakeIterator << endl;
printf("hello, world \n");
return 0;
}
// cplus_list_test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <list>
//using namespace std;
int main(int argc, char* argv[])
{
list<string>::iterator MilkshakeIterator;
list<string> Milkshakes;
Milkshakes.push_back("Chocolate");
Milkshakes.push_back("Strawberry");
Milkshakes.push_front("Lime");
Milkshakes.push_front("Vanilla");
for (MilkshakeIterator = Milkshakes.begin(); MilkshakeIterator != Milkshakes.end(); ++MilkshakeIterator)
cout << *MilkshakeIterator << endl;
printf("hello, world \n");
return 0;
}
相关文章推荐
- 全排列 和 C++ string类 NYOJ 19
- POJ - 2230 Watchcow
- C以及C++语言中static作用
- C++中引用的本质
- c++中char *与string之间的相互转换及原理
- 1.C++ STL基本容器的使用(转载)
- C++的运算符重载 (转)
- C语言文件操作详解
- 【Effective C++读书笔记】篇六(条款13~条款15)
- 详解C语言可变参数va_list和vsnprintf及printf实现
- C++ 字符char相关操作
- STL--C++中 destory() 和deallocate()以及delete函数的相关性和区别性,destorydeallocate
- C&C++学习笔记2
- Tyvj 1066 合并果子
- C语言中的可变参数函数 三个点“…”
- C++ primer plus笔记整理 04
- C语言 函数指针三(反向调用)
- C++的s输出
- 【训练题】二分图判定
- BZOJ 1150 [CTSC2007] 数据备份Backup