Long long int in C, Mac OS X, Xcode 3.2.5, field width

In this example:

long long int x = 1<<38;
NSLog(@"Hello, World!, %qi", x);

I got a “warning: left shift> = type width” and a value of 0 for x.

The length of the long long int is 8, so we should be able to move up 63.

I am puzzled ... And will avoid some help.

+3
source share
1 answer

It is not xthat problem, it is 1that which is a signed integer constant .

Try this instead:

long long int x = 1LL << 38;
+14
source

Source: https://habr.com/ru/post/1788548/


All Articles