为什么在dev-c++里编译不通过.在vc6.0里却可以通过

#include <iostream.h>

int big(int x,int y);

int main()
{
int a,b,c;
cout<<"intpu a and b";
cin>>a>>b;
c=big(a,b);
cout<<"a,b,c="<<a<<','<<b<<','<<c<<endl;
cout<<"int a and b again";
cin>>a>>b;
c=big(a,b);
cout<<"a,b,c="<<a<<','<< b<<','<<c<<endl;
return 0;
}

int big(int x,int y)
{
if(x>=y)return x;
else return y;
}
补充:将#include <iostream.h>换成#include <iostream>也不行.错误更多.
刚才在网上查了下资料.原来是dev-c++支持新的C++标准.而VS6.0对新标准支持的不够.新标准一定要加命名空间.加上using namespace std;这一句就可以了. 谢谢刚才回答我问题的朋友,虽然回答的跟我的问题不是很相关.但还是给你给你加分了.

用Dev-C++编写C++项目时,如果用菜单"Debug\Debug"调试时,系统会提示"Your project does not have debugging information, do you want to enable debugging and rebuild your project?",此时即使选"Yes"也还是不能调试.要在"Project/Class Brower"窗口中(通过View\Project/Class Brower调出该窗口),然后选中项目按右键,选"Project Options"在"Compiler"页中选"Linker"项,将其中的"Generate debugging information"设为"Yes".此时再重新链接一次程序,就可以调试了.

参考资料:http://hi.baidu.com/kelvin_yin/blog/item/3f2710304c2de299a9018e4d.html

温馨提示:答案为网友推荐,仅供参考
相似回答