| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 688 人关注过本帖
标题:今天在dev下面编了个程序,运行不能通过,但在vc下即可通过?
只看楼主 加入收藏
rainyee
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2007-10-20
收藏
 问题点数:0 回复次数:3 
今天在dev下面编了个程序,运行不能通过,但在vc下即可通过?
是不是dev和VC的编译器不同啊?
搜索更多相关主题的帖子: dev 运行 
2007-10-31 20:47
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
收藏
得分:0 

支持标准稍有不同,楼主帖点代码吧


Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2007-10-31 21:15
rainyee
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2007-10-20
收藏
得分:0 
#include<iostream>
#include<string>
using namespace std;
template<typename T>
T less(T a,T b)
{
if(a>b)return b;
else return a;
}
int main()
{
double a=5.6,b=7.2;
cout<<"the less of the two is:"<<less(a,b)<<endl;
system("pause");
return 0;
}
你看看吧,我在dev下面调试不行,在VC下面就可以

當你在 穿山越嶺的另一邊 我在孤獨的路上 沒有盡頭......
2007-10-31 21:22
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
收藏
得分:0 
恩,确有这样的现象,支持标准不同吧,编译器间的差异,这个不好解释的,代码应没错的,

Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2007-10-31 21:42
快速回复:今天在dev下面编了个程序,运行不能通过,但在vc下即可通过?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013566 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved