long long int in C, Mac OS X, Xcode 3.2.5, field width
In this sample:
long long int x = 1<<开发者_C百科;38;
NSLog(@"Hello, World!, %qi", x);
I got "warning: left shift count >= width of type", and the value zero for x.
The length of a long long int is 8, so we should be able to shift up 63.
I'se puzzled....And would sho' 'preciate some help.
It's not x
that's the problem, it's the 1
, which is a signed integer literal constant.
Try this instead:
long long int x = 1LL << 38;
精彩评论