奇怪的行为,Borland编译器中的错误? [英] Strange behaviour, bug in Borland compiler?
问题描述
您好!
执行以下行:
int x = 1;
x = x> 2345678901;
您将获得:
x == 1与Borland C ++ Builder
x == 0与Microsoft Visual Studio
" int"两个编译器都是32位。
所以结果应该是一样的。
这是Borland编译器中的一个错误吗?
问候,
Markus Sandheide
Hello!
Execute these lines:
int x = 1;
x = x > 2345678901;
You will get:
x == 1 with Borland C++ Builder
x == 0 with Microsoft Visual Studio
"int" is 32 bit in both compilers.
So the result should be the same.
Is this a bug in the Borland compiler?
Greetings,
Markus Sandheide
推荐答案
Markus Sandheide写道:
Markus Sandheide wrote:
您好!
执行以下行:
int x = 1;
x = x> 2345678901;
你会得到:
x == 1与Borland C ++ Builder
x == 0与Microsoft Visual Studio
" INT"两个编译器都是32位。
所以结果应该是一样的。
这是Borland编译器中的一个错误吗?
Hello!
Execute these lines:
int x = 1;
x = x > 2345678901;
You will get:
x == 1 with Borland C++ Builder
x == 0 with Microsoft Visual Studio
"int" is 32 bit in both compilers.
So the result should be the same.
Is this a bug in the Borland compiler?
看起来就像缺少你的C ++知识一样。阅读最新的ISO
C ++书籍。
您可以查看 http://www.accu.org 在书评部分。
另请查看我的一页:
< a rel =nofollowhref =http://www23.brinkster.com/noicys/learningcpp.htmtarget =_ blank> http://www23.brinkster.com/noicys/learningcpp.htm
-
Ioannis Vranos
http://www23.brinkster.com/noicys
It looks like a missing in your C++ knowledge. Read an up to date ISO
C++ book.
You may check http://www.accu.org at the book reviews section.
Also take a look at a page of mine:
http://www23.brinkster.com/noicys/learningcpp.htm
--
Ioannis Vranos
http://www23.brinkster.com/noicys
Markus Sandheide写道:
Markus Sandheide wrote:
你好!
执行以下几行:
int x = 1;
x = x> 2345678901;
你会得到:
x == 1与Borland C ++ Builder
x == 0与Microsoft Visual Studio
" INT"两个编译器都是32位。
所以结果应该是一样的。
这是Borland编译器中的错误吗?
Hello!
Execute these lines:
int x = 1;
x = x > 2345678901;
You will get:
x == 1 with Borland C++ Builder
x == 0 with Microsoft Visual Studio
"int" is 32 bit in both compilers.
So the result should be the same.
Is this a bug in the Borland compiler?
看起来像Borland C ++ Builder中的一个错误
-
Karl Heinz Buchegger
kb ****** @ gascad.at
Ioannis Vranos写道:
Ioannis Vranos wrote:
看起来你的C ++知识缺失了。阅读最新的ISO
C ++书籍。
您可以查看 http://www.accu.org 在书评部分。
另请查看我的一页:
http://www23.brinkster.com/noicys/learningcpp.htm
It looks like a missing in your C++ knowledge. Read an up to date ISO
C++ book.
You may check http://www.accu.org at the book reviews section.
Also take a look at a page of mine:
http://www23.brinkster.com/noicys/learningcpp.htm
换句话说,检查两个编译器中的以下代码:
#include< iostream>
#include< limits>
int main()
{
使用命名空间std;
int x = 1;
cout<< (x> numeric_limits< int> :: max())<<" \ n" ;;
}
-
Ioannis Vranos
http: //www23.brinkster.com/noicys
这篇关于奇怪的行为,Borland编译器中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!