c++ - 为什么字符串声明会终止 VScode 中的程序?
问题描述
我在带有 mingw 的 Windows 中使用 VScode。我已经安装了 C/C++ 扩展并正确配置了Intellisense 模式和tasks.json(我遵循了本教程https://code.visualstudio.com/docs/cpp/config-mingw#_build-helloworldcpp)。在我使用字符串之前一切正常。我可以毫无问题地使用其他数据类型和容器。
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<"working";
string s;
cin>>s;
cout<<s;
return 0;
}
该程序终止而不打印任何内容,尽管它不会引发任何错误。
解决方案
推荐阅读
- java - 将 Spring 模型发送到 Freemarker 头标签,没有特定路线
- javascript - 不能循环遍历 React 中的对象?
- events - 如果成员说出特定单词,则自动将其静音 discord py rewrite
- php - CodeIgniter 4 验证匹配选项的正确语法
- php - 将 FIND_IN_SET(SUBSTRING 与数据表编辑器一起使用
- mysql - 如何在 django 原始查询中编写 DATE_FORMAT(now(), "%m/%d/%Y")
- django - 我想在 Django 数据库中创建表,通过从 Web 界面上传 excel 或 csv 表来创建动态字段
- html - 在行和列中一个接一个地显示列表项
- reactjs - 对于 React 中的有效数据集,胜利图未在负轴上绘制笔画
- python - 如何获得可理解的 DecisionTreeClassifier 输出?