Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unsigned long long to string convert

Tags:

c

I try to convert unsigned long long to string like this

unsigned long long Data = 12;
char Str[20];

sprintf(Str, "%lld",Data);

when i want to see but i always see 00

Str[0],Str[1]....;

whats the wrong !!!

like image 230
user477085 Avatar asked Oct 27 '25 08:10

user477085


1 Answers

In most cases, %llu should do the trick. But you might have to use %I64u on some Windows platforms.

like image 104
Frédéric Hamidi Avatar answered Oct 29 '25 23:10

Frédéric Hamidi