目录
环境
安装 C++ entendsion
安装 clang
检查系统是否安装了 clang
clang --version
如果没有安装,则执行
xcode-select --install
编写程序
#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;
}
编译运行
设置编译
选择 Terminal > Configure Default Build Task.