注册 登录
编程论坛 C++教室

关于头文件iostream

kscooh1 发布于 2011-09-17 06:22, 2876 次点击
我为什么找不到头文件iostream  程序如下:
#include <iostream>
using namespace std;

int main()
{
    bool check=trun;
    if(check==true)
    {
        cout<<"hello world\n";
    }
    return 0;
}
编译错误:
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.cpp
d:\c语言学习\程序\1.cpp(1) : fatal error C1083: Cannot open include file: 'iostream': No such file or directory
Error executing cl.exe.

1.obj - 1 error(s), 0 warning(s)
求指教
6 回复
#2
hackhu2011-09-17 09:47
程序代码:
#include <iostream>
using namespace std;
int main()
{
    bool check=true;   //你的这里输入成trun了。
    if(check==true)
    {
        cout<<"hello world\n";
    }
    return 0;
}

 
#3
晴天一阵2011-09-17 09:50
#include <iostream>
using namespace std;

int main()
{
    bool check=true;
    if(check==true)
    {
        cout<<"hello world\n";
    }
    return 0;
}
.....楼上正解。。
#4
can39811322011-09-19 11:05
check 初值都有问题
#5
八画小子2011-09-19 16:39
楼主问的问题应该是编译器的问题吧。可能是你的编译器没有更新到遵循最新的C++标准。如果不想换编译器,可以改用以.h为扩展名的头文件。
#6
八画小子2011-09-19 16:40
但也不排除你的编译环境没有设置正确的可能
#7
清风一然2011-09-19 22:49
你可以试下这个程序
#include<iostream>
using namespace std;
int main()
{
  cout<<"hello world!"<<endl;
  return 0;
}
1