This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Long long Int value sprintf

Hi, I am working with nrf9160, I want to convert INT64 timestamp value to CHAR array with sprintf. I use %lld but sprintf said only "ld" if I use %ld it convert only low side 32 bit value. I tried printk fonction for print int64 value on screen It is working. I looked inside fonctions both are using same core code. I don't understand why it doesn't do conversion. Mybe I forgot some CONFIG settings. How can I convert INT64 long long value to char array?

My code:

sprintf(timestampChar,"%" PRId64 "\n",timestamp );
//sprintf(timestampChar,"%lld",timestamp );
both sprintf doesn't work! When it convert it writes this "ld" any number value
printk("%lli\n", timestamp);
printk work!
Related