用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键,程序正常运行

本文介绍在Visual Studio 2010中使用C++编程时遇到的错误提示“无法打开包括文件: 'iostream.h'”。错误原因是VS2010不再支持iostream.h,正确的做法是使用<iostream>并引入std命名空间。通过简单的修改即可让程序正常运行。
6209

被折叠的 条评论
为什么被折叠?



