Bamboozled by long long

Gokhan Kisacikoglu kisa@centropolisfx.com
Fri Jul 19 12:29:00 GMT 2002


> unsigned long long k=1;
> unsigned int i = 4;
> printf("The values are i: %d, , k: %LX, i+k: %LX \n", i,k , i+k);
> k = k + i;
> printf("The values are i: %d, , k: %LX, i+k: %LX \n", i,k , i+k);
> 
> ...depending on the extension (or convention for long long) used.
> 
> --Eljay


This is not correct, this will only work with double precision float
numbers. "long long" is really "long long int" and only ll should be
used. This is from the man page (on my system):

        ll   For n, the argument has type pointer to long long int; for
d
             and i, long long int; and for o, u, x, and X, unsigned long
             long int.

        L    For b, B, e, E, f, g, and G, the argument has type long
             double.



More information about the Gcc-help mailing list