我是 C++ 新手。我刚开始!我在 Visual C++ 2010 Express 版本上尝试了代码,但收到以下代码错误消息。
------ 构建开始:项目:abc,配置:调试 Win32 ------
ugo.cpp
c:\users\castle\documents\visual studio 2010\projects\abc\abc\ugo.cpp(3):致命错误 C1083:无法打开包含文件:'iostream':没有这样的文件或目录
========== 构建:0 成功,1 失败,0 最新,0 跳过 ==========
这是代码:
// first.cpp -- displays a message
#include <iostream> // A PREPROCESSOR directive
int main(void) // Function header
{ // Start of a function body
using namespace std;
cout << "Come up and C++ me sometime.\n"; // Message
// Start a new line
cout << "Here is the total: 1000.00\n";
cout << "Here we go!\n";
return 0;
}
原文由 jamesbond 发布,翻译遵循 CC BY-SA 4.0 许可协议
我也有这个问题。我在 Visual Studio 2022 中使用了这段代码(在 main(); 之前),结果没问题: