zoukankan      html  css  js  c++  java
  • vector-end

    ////////////////////////////////////////
    //      2018/04/16 9:46:45
    //      vector-end
    
    #include <iostream>
    #include <vector>
    #include <iterator>
    #include <numeric>
    
    using namespace std;
    
    int main(){
        vector<int> v(5);
        iota(v.begin(),v.end(), 1);
    
        vector<int>::iterator it = v.begin();
        while (it != v.end()){
            cout << *(it++) << " ";
        }
        cout << endl;
    
        // last element of the vector
        it = v.end() - 1;
        cout << *it << endl;
        return 0;
    }
    
    /*
    OUTPUT:
        1 2 3 4 5
        5
    */ 
  • 相关阅读:
    Rx
    linux rpm 安装包制作
    kamctl start
    dedicated bearer
    Kamailio
    EPC sequence
    TD-LTE技术原理与系统设计
    SS7
    SCTP
    GTP
  • 原文地址:https://www.cnblogs.com/laohaozi/p/12538047.html
Copyright © 2011-2022 走看看