Re: Array to integer problem(integer too long).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Victor,

%d expects an int parameter, not a long long.
%ll is not a valid conversion specifier.
%L is not a valid conversion specifier.
%q is not a valid conversion specifier.

NOTE:  9223372036854775807LL is the largest long long.

Try this...

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
   long long test;
   test = 89126342536LL;
   printf("Test d : %d  \n", (int)test); // truncate to int for %d
   printf("Test ll: %lld \n", test); // %lld for long long
}

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux