Home/Support/Support Forum/printing 64bit numbers with printf
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

printing 64bit numbers with printf

0 votes

I'm trying to print 64bit number using printf but it does not work.
This code prints number as -2147483648 , it looks that i is not recognized like 64bit but 32bit in printf.
I tried to use int64_t and same result.

If i do sizeof(i) it recognize that is 64bit number.

long long int i;

i = (long long int)2147483648L;

printf (" %lld \n", (long)(long)(int)i);

asked Jun 4, 2013 in NET+OS by zaricd New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
Hello , Check the below link

answered Jun 6, 2013 by cpigilam Veteran of the Digi Community (655 points)
Thanks for help , this is standard that should work on any GCC but it does not in NetOS,.
I created custom function for this that solves my problem.