vector-at

////////////////////////////////////////
//      2018/04/15 17:40:29
//      vector-at
#include <iostream>
#include <vector>

using namespace std;

int main(){
    vector<int>v(3, 0);
    v[0] = 100;
    v.at(1) = 200;

    for (int i = 0; i < 3; i++){
        cout << v.at(i) << " ";
    }
    cout << endl;
    return 0;
}
// OUTPUT:
// 100 200 0
原文地址:https://www.cnblogs.com/laohaozi/p/12538060.html