This question is not appropriate for this mailing list, questions
about using GCC should be sent to the gcc-h...@gcc.gnu.org list,
please take any follow up there, thanks.
On 24 February 2012 08:34, Yang Yueming wrote:
>
> The result of xyz should be "0",but it is "2468acf123579bc" ,same as xyz =
Yang Yueming writes:
> long long abc = 0x01234567891abcde;
> long long xyz;
...
> xyz = abc << 65;
...
> The result of xyz should be "0",but it is "2468acf123579bc" ,same as
> xyz = abc << 1,Why?
Because the shift operators in C have an undefined result when the
shift-count is larger than
Case:
#include
#include
long long abc = 0x01234567891abcde;
long long xyz;
int main ()
{
xyz = abc << 65;
printf("%llx\n", xyz);
return 0;
}
The result of xyz should be "0",but it is "2468acf123579bc" ,same as xyz = abc
<< 1,Why?
So as for "i