g++ c++11 c++0x

g++要想支持c11的话,编译时

g++ -o t test.cpp -std=c++0x

g++ -o t test.cpp -std=c++11

 

#include <iostream>
#include <array>

using namespace std;

int main() {
    array<int, 10> a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    a[0] = 22;
    cout<<a.at(0)<<endl;
    cout<<a.back()<<endl;
    return 0;
}

 

posted @ 2020-05-16 10:50  kissrule  阅读(309)  评论(0)    收藏  举报