小编Aar*_*ang的帖子

Mac VSCode 调试器总是显示有关“;”的错误 和 ':'

我正在尝试在我的 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, …

c++ c++11 visual-studio-code vscode-debugger

5
推荐指数
2
解决办法
3419
查看次数

标签 统计

c++ ×1

c++11 ×1

visual-studio-code ×1

vscode-debugger ×1