fatal error C1083: Cannot open include file: 'iostream.h'错误解决方法

来源:互联网 发布:炒股入门软件知乎 编辑:程序博客网 时间:2024/05/21 01:51

有初学C++者经常会出现如下错误: 

fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory。 

这个错误一般在使用Visual C++ .NET 2005或以上版本时出现。 

原因,iostream.h为C类库,C++类库中应该为iostream。 

另外cin,cout等函数在std命名空间中。使用时应加上using namespace std; 

解决方法:将#include <iostream.h> 

改为#include <iostream> 
using namespace std;

原创粉丝点击