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

这简单的程序错在哪里

crike 发布于 2011-07-08 10:58, 1085 次点击
程序代码:
#include<<iostream>>
vodi main()
{
cout<<"hello the world!"<<endl;
}
我刚接触C++ 写了一个简单的程序 可是就是编译出错 我下载的vc6.0 也不提示错误在哪 怎么弄?
12 回复
#2
zhoufeng19882011-07-08 11:31
程序代码:

#include<iostream>
void main()
{
cout<<"hello the world!"<<endl;
}

#3
lucky5635912011-07-08 11:52
受不了,竟然用两个尖括号,void也写成那样
#4
pangding2011-07-08 12:17
vc6 难道连这些错误都提示不出来……
#5
lianjiecuowu2011-07-08 14:15
#include<iostream>
void main()
{
cout<<"hello the world!"<<endl;
}
是不是应该重新看下书啊
#6
crike2011-07-08 14:29
真的没有看出来 请高手指出错误啊  入局者迷啊
#7
ToBeStronger2011-07-08 14:47
额.........还要写using namespace std;........
#8
dxl1025863422011-07-08 16:31
哈哈 终于看到人指出 using namespace std;了 哈哈
要是不想写这个可以写成#include<iostream.h>不过不推荐
 最终的样子为
程序代码:
#include<iostream>
using namespace std;
void main()
{
    cout<<"Hello World"<<endl;
}
或者用另一种,不过不推荐
程序代码:
#include<iostream.h>
void main()
{
    cout<<"Hello World"<<endl;
}

#9
烟雾中的迷茫2011-07-08 16:42
简直晕死人
#10
bolin432102011-07-09 13:00
#include<iostream>                  //单尖括号
using namespace std;               //加命名空间
void main()                        //void 写正确
{
cout<<"hello the world!"<<endl;
}
现在编译运行就正确了!
#11
十八太保2011-07-09 21:50
建议重新看看书
#12
那个人啊2011-07-21 22:08
其实我更喜欢这种:
#include<iostream>
int main()
{
    std::cout<<"Hello!World!"<<std::endl;
    return 0;
}
我是低级小菜鸟。
#13
zhangqi_gsts2011-07-21 23:37
include<iostream>
void main()
{
    std::cout<<"Hello World"<<endl;
}
1