I need to print an unsigned long long variable:
unsigned long long t = 1559072327000ULL;
I have tried the following:
Serial.println(t); // call of overloaded 'println(uint64_t&)' is ambiguous
char[18] buf;
sprintf(dt, 18, "%lu", t); // Prints 4294165848
snprintf(dt, 18, "%lu", t); // Prints 126
vsnprintf(dt, 18, "%lu", t); // cannot convert 'uint64_t {aka long long unsigned int}' to '__gnuc_va_list {aka __va_list_tag}'
Any suggestion?
asked May 28, 2019 at 20:20
1 Answer 1
Okay, I figured out... this two prints the right number:
sprintf(dt,"%llu", t);
snprintf(dt, 18, "%llu", t);
answered May 28, 2019 at 20:21
char[18] buf;
<-- what on earth is this? When you intend to post code in your question, please don't fake the code. Post the real code you actually tried to use.