我正在尝试在我的 Mac 上设置 vscode 环境。我按照网站上的步骤进行操作https://code.visualstudio.com/docs/cpp/config-clang-mac 但是当我尝试调试我的程序时,它显示错误并且无法跳过。我不确定是因为版本还是其他什么原因。
#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 << " ";
}
vector<string> aaa {"H", "E", "L", "L", "O"};
for (const string& word : aaa)
{
cout << word << " ";
}
cout << endl;
}
Run Code Online (Sandbox Code Playgroud)
并且错误消息显示
预计 ; 在声明的末尾 [9, 23] 期望 ; 声明末尾 [16, …