error C1083: 无法打开包括文件:“iostream.h”: No such file or directory

用VS2010打开VC++6程序,按下F5键会发现有错误提示:error C1083: 无法打开包括文件:“iostream.h”: No such file or directory ;而程序在VC++6中没有任何问题!

主要的原因是:

1.#include<iostream.h>是原来的C语言里面的,而#include<iostream>是c++的标准库里的,而要调用这个这个标准库需要: using namespace std;

2.iostream.h已经不被.net支持了。
解决办法:将#include <iostream.h>修改为以下两行代码:

#include <iostream>

using namespace std;

按下F5键,程序正常运行。

posted @ 2023-07-29 23:26  rainbow70626  阅读(629)  评论(0编辑  收藏  举报