Dev C++ 无法支持 C++ 中的 iostream.h 头文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17738738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Dev C++ couldn't support with iostream.h header file in C++
提问by CAPRICORNER
Why the "Dev C++" couldn't support with iostream.h header file in C++..? How can I include iostream.h header file in Dev C++?
为什么“Dev C++”不能支持 C++ 中的 iostream.h 头文件?如何在 Dev C++ 中包含 iostream.h 头文件?
回答by Mark Garcia
First of all, Dev C is not a compiler, it's an IDE that interfaces with a compiler (most presumably GCC/MingW in your case). The compiler suite is the one having the header files, not the IDE.
首先,Dev C 不是编译器,它是一个与编译器接口的 IDE(在您的情况下最有可能是 GCC/MingW)。编译器套件是具有头文件的套件,而不是 IDE。
Just do
做就是了
#include <iostream>
instead of
代替
#include <iostream.h>
and also add using namespace std;
to execute cout
and cin
in Dev C program.
并添加using namespace std;
到执行cout
和cin
开发 C 程序中。
回答by chris
<iostream.h>
is not a standard header file (if anything supports it, it's for backward compatibility from long ago). Use <iostream>
instead. None of the header files introduced in C++ have an extension. The same advice goes for <fstream>
over <fstream.h>
as well.
<iostream.h>
不是标准的头文件(如果有任何支持,它是很久以前的向后兼容性)。使用<iostream>
来代替。C++ 中引入的头文件都没有扩展名。同样的建议也适用于<fstream>
以上<fstream.h>
为好。
回答by Santhosh Pai
try to include this way.
尝试以这种方式包括在内。
#include<iostream>