致命错误:iostream.h没有这样的文件或目录 [英] fatal error: iostream.h no such file or directory

查看:2867
本文介绍了致命错误:iostream.h没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

没有这样的文件iostream.h包括

即使在用.cpp扩展名命名源文件后。我的编译器给出这个错误,在命令提示符和代码块。如何解决此问题?

Even after naming the source file with .cpp extension. my compiler gives this error, both in command prompt and Codeblocks. How can I fix this issue?

#include <iostream.h>


int main(){

    cout<<"Hello World!\n";
    return 0;
}


推荐答案

在标准C ++。它是1990年代以前的编译器的一部分,但它肯定不是C ++的一部分。

That header doesn't exist in standard C++. It was part of some pre-1990s compilers, but it is certainly not part of C++.

使用 #include< iostream> 。并且所有的库类都在 std :: 命名空间中,对于ex­ am­ ple std :: cout

Use #include <iostream> instead. And all the library classes are in the std:: namespace, for ex­am­ple std::cout.

此外,请丢弃任何提及您说的内容的书籍。

Also, throw away any book or notes that mention the thing you said.

这篇关于致命错误:iostream.h没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆