小编Sid*_*pta的帖子

GCC:在OS X 10.11.5上找不到架构x86_64错误的ld:符号

我一直在尝试运行一个简单的矢量代码,我在互联网上看到,以了解矢量的工作原理.

#include <iostream>
#include <vector>
using namespace std;

int main(int argc, char** argv) {
    /*  Initialize vector of 10 copies of the integer 5 */

    vector<int> vectorOne(10,5);

    /*  run through the vector and display each element, if possible */

    for (long index=0; index<20; ++index) {
        try {
            cout << "Element " << index << ": " << vectorOne.at(index) << endl;
        }
        catch (exception& e) {
            cout << "Element " << index << ": index exceeds vector dimensions." << endl;
        } …
Run Code Online (Sandbox Code Playgroud)

c++ gcc vector

3
推荐指数
1
解决办法
4831
查看次数

标签 统计

c++ ×1

gcc ×1

vector ×1