سؤال

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().

هل كانت مفيدة؟

المحلول

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

uint64_t t = 42;
printf("%" PRIu64 "\n", t);

نصائح أخرى

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

u_in64_t number;
printf("%Lu", number);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top