cout在cin之前没有在visual studio社区C++中工作
cout not working before cin in visual studio community C++
此代码给我错误:
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int main()
{
string name;
cout << "enter your name: "<<endl;
cin >> name;
cout << name << endl;
return 0;
}
错误为:错误LNK1104无法打开文件"c:\users\payman\documents\visual studio 2015\Projects\ConsoleApplication2\Debug\ConsoleApplication2.exe"
但如果我评论第一个cout声明,它是有效的。不明白为什么。
您的程序仍在运行,因此文件被锁定。这与代码完全无关。
相关文章:
- 编译器错误(英特尔并行工作室 2019 与 Visual Studio 社区 2019)
- 如何覆盖 Visual Studio 2017 社区的编译命令
- 如何在Visual studio 2017社区版中编译字节币源代码
- 部署应用程序,C++,Visual Studio 2015社区版本
- Microsoft Visual Studio 2017社区中的MQL4至C DLL
- 将Win32控制台项目模板添加到Visual Studio社区2017 15.5.2
- Visual Studio社区2017 Linker问题-Mariadb
- 使用Visual Studio 2015社区版为应用程序制作安装程序,其中集成了VC++ 2015环境
- 在 Visual Studio 2015 社区中消除错误时出错
- GLFW无法在Visual Studio社区中工作
- Visual Studio 2015 社区 - "Visual C++ Project System Package"错误
- 在Visual Studio 15社区中构建Lua的解决方案/项目结构
- 在Visual Studio 2015社区C ++中,如何修复警告C4838:从'unsigned int'到'int'的转换需要缩小转换范围
- 更改默认代码 Visual Studio 2015 社区
- 链接错误1561 visual studio社区2015
- cout在cin之前没有在visual studio社区C++中工作
- 为什么 iostream 在 Visual Studio 社区中对我不起作用?
- 在c++ Visual Studio 2015社区中获取本地时间
- gets()函数在Visual studio 2015社区中不可用
- 包含Visual Studio 2015社区版c++中的excel错误