如vs中的错误提示所示:“iostream.h”没找到。
iostream.h与iostream是不同的。
#include
using namespace std;
其原因是:后缀为.h的头文件C++标准已经明确提出不支持了,早些的实现将标准库功能定义在全局空间里,声明在带.h后缀的头文件里,C++标准为了和C区别开,也为了正确使用命名空间,规定头文件不使用后缀.h。因此,当使用
头文件错误没有iostream.h 改成iostream 再加名词空间Using namespace std;
还有只能有1个main
#include
using namespace std;
int main()
{
..
}
贴下代码上来吧