turbo c++3.0 中编译C++提示unable to open include file 'iostream',

来源:百度知道 编辑:UC知道 时间:2024/09/21 06:31:19
源代码:
include <iostream>
using namespace std;

int main()
{
int x,i;
cin>>x;
i=x%2;
if (i==2)
{cout<<'odd'<<endl} else
{cout<<'not odd'<<endl};
}

应该是 iostream.h

但是上面那个回答也有问题。 不写.h意味着你要的就是 iostream没扩展名的这么个文件。 这个文件是98年的c++标准规定的, 所以不写.h完全是正确的。 这个错问题不在于你, 而是在于turbo c++这种老掉牙的东西是不符合这个新标准的, 所以你要用的话也就只能跟着写旧形式的代码了

错了 iostream 改成 iostream.h
申明头文件,必须把后面的 .h 写上

turbo c++太老古董了

初学者建议用g++,对C++的最新标准支持的很好

为了适用于turbo c++,必须使用iostream.h这种过时的写法,而不是新规范的iostream