mbp m1 c++ vscode配置

  1. 新建一个空目录
    mkdir oj
    cd oj
  2. 创建cpp文件 helloworld.cpp
    复制以下测试代码:
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};

    for (const string& word : msg)
    {
        cout << word << " ";
    }
    cout << endl;
}
  1. 参照下面的参考文献
上一篇:普通函数与函数模板的区别(CPP)


下一篇:2021-10-09