Jason的菜地
谁言书生无用,笔下自有乾坤
#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;
}

 

posted on 2017-12-09 17:51  贾森  阅读(498)  评论(0)    收藏  举报