CHAPTER6-8.cpp
上传用户:fjc899
上传日期:2007-07-03
资源大小:187k
文件大小:1k
源码类别:

STL

开发平台:

C/C++

  1. //文件名:CHAPTER6-8.cpp
  2. #pragma warning(disable:4786)
  3. #include <iostream.h>
  4. #include <vector>
  5. using namespace std;
  6. void main (void) 
  7. {
  8. vector<char> Myvector;
  9. vector<char>::iterator MilkshakeIterator;
  10. Myvector.push_back('1');
  11. Myvector.push_back('2');
  12. Myvector.push_back('3');
  13. Myvector.push_back('4');
  14. Myvector.push_back('5');
  15. Myvector.push_back('6');
  16. for (MilkshakeIterator=Myvector.begin(); MilkshakeIterator!=Myvector.end(); ++MilkshakeIterator) 
  17. { cout<<*MilkshakeIterator<<" "; }
  18. }