#include <iostream> #include <vector> using namespace std; int main() { //////////////////// string 测试 string s = "hello World."; // string s("Hello World."); //这样写也可以的 cout<< s << std::endl; //////////////////// vector容器 测试 vector<int> iVec; int i; for(i = 0; i < 10; i++) { iVec.push_back(i); } //////////////////// 迭代器 测试 auto b = s.begin(); //C++11的简易写法 auto e = s.end() ; vector<int>::iterator it; //以前的写法,应该没人喜欢了吧 for( ; b != e; ++b) { *b = toupper(*b); } cout << s << endl; return 0; }