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

初级问题,多多关照

science 发布于 2006-12-27 14:50, 484 次点击
我刚学c++,虽然学c有不少时间,我刚下载了一个c++的编译环境,是Dev-c++4.9.9.0
但是编了一个小程序,有点问题。程序如下:
#include<iostream.h>
main()
{ int a,b,c;
cout<<"enter number a: b: "
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
}

怎么运行后,出现提示:source file not compiled
不知道是怎么回事
4 回复
#2
pusawl2006-12-27 21:25
老老实实用VC++吧
#3
yuyunliuhen2006-12-27 22:03

没用过那个编译器,不过建议换个编译器吧
VC++ 6.0是比较流行的编译器,这个不错。

#4
caiqiufu2006-12-27 23:19
#include<iostream.h>
void main()
{ int a,b,c;
cout<<"enter number a: b: ";
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
}
可以了
#5
smartwind2006-12-28 08:33
应该这样写:
#include<iostream>
using namespace std;
int main()
{ int a,b,c;
cout<<"enter number a: b: "
cin>>a>>b;
c=a+b;
cout<<"the result is"<<c<<endl;
return 0;
}

还在用VC++6.0写C++程序的建议升级到2005
1