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

有初学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

改为#include
using namespace std;

你可能感兴趣的:(C++)