= width of type\", and the value zero for x." />
开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜