[Error] iostream.h: No such file or directory
时间: 2023-08-26 18:09:00 浏览: 225
iostream.h头文件
报错信息"\[Error\] iostream.h: No such file or directory"是因为在代码中使用了旧版本的头文件iostream.h,而该头文件在新版本的编译器中已经被移除了。正确的做法是使用新版本的头文件iostream,并添加命名空间std。以下是正确的代码:
#include <iostream>
using namespace std;
int main(void) {
int input;
cout << "please input a number:" << endl;
cin >> input;
cout << "the number is:" << input << endl;
}
这样修改后,就可以避免报错"\[Error\] iostream.h: No such file or directory"了。\[1\]
#### 引用[.reference_title]
- *1* [[Error] iostream.h: No such file or directory解决办法](https://blog.csdn.net/weixin_51582806/article/details/126887714)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [C++编译出现iostream no such file or directory的原因](https://blog.csdn.net/lynn_ming/article/details/79713058)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [关于“iostream.h”: No such file or directory的问题](https://blog.csdn.net/m0_61230267/article/details/130179280)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文