Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want a solution for printf [duplicate]

Possible Duplicate:
how to printf uint64_t?

I want to print u_int64_t in C. I want to know the format specifier for this? I am a C user, I want to do a printf().

like image 277
Invictus Avatar asked Jul 24 '12 20:07

Invictus


2 Answers

#include <inttypes.h>
#include <stdio.h>

uint64_t t = 42;
printf("%" PRIu64 "\n", t);
like image 152
ouah Avatar answered Oct 31 '22 18:10

ouah


You can use the L modifier for 64-bit integers, eg:

u_in64_t number;
printf("%Lu", number);
like image 42
Remy Lebeau Avatar answered Oct 31 '22 16:10

Remy Lebeau