c++ - 向量msg {} 不是在 Mac 上的 VS Code 中为 C++ 构建
问题描述
我正在尝试在 Mac(英特尔)上配置 VS Code 以使用 C++ 进行开发。我正在关注 VS Code 网站上的设置。当我到达终端时,按照所有步骤 - 运行构建任务,构建失败并指示它需要一个“;” 在“味精”之后。我可以在 XCode 中毫无问题地运行相同的文件,但是 VS Code 失败了。这是来自 VS Code 设置站点的完整代码。
#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;
}
解决方案
推荐阅读
- plugins - 用于新闻和事件的 Ckan 插件
- image - 图像在数组映射上不可见
- excel - 如何检查列的 1 文本是否存在于 Excel 的列 2 文本中
- ruby-on-rails - Nginx - Puma - Rails 堆栈中的 URI 应该在哪里解码?
- c# - C# linq 是否支持“反连接”语义?
- sails.js - 如何在sails js中获取上传的图片url
- java - java.io.IOException:尝试从 JAR 访问 XML 文件时,流已关闭
- xml - xml to linq,如何修复后期绑定?
- angular - 如何从 IHttpActionResult 数据在 Angular 中创建 blob 对象 (.PDF)?
- ansible - 如何为特定或自定义平台运行分子测试?