添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hello,

I would like to print signed long long int (s64_t ) values using printk or printf.

I tried some suggestions I found online %lli , %lld but they did not work.

Please advise.

Thank you.

Kind regards

Mohamed

With ncs v1.5.0-rc1 (with minimal lib c), it should print 64 bit numbers using printk(). I added this to the hello_world sample:

	int64_t long_num = 0x10000000000;
	printk("%lli\n", long_num);

And it prints:

Hello World! nrf9160dk_nrf9160
1099511627776

Which tag are you on?

Kind regards,

Håkon

Thank you Hakon,

Yes, it works with int64_t type but for some reason it did not work with s64_t type which is what I was using when I posted my ticket.

Kind regards

Mohamed

Learner said:
I am not sure which tag you are referring to.