I want to convert a NSString
to int64_t
and then print it out using:
NSLog("%lld", i);
Now I can only convert using [str integerValue]
which sometimes makes it print out the minus number.
I want to convert a NSString
to int64_t
and then print it out using:
NSLog("%lld", i);
Now I can only convert using [str integerValue]
which sometimes makes it print out the minus number.
You can use [str longLongValue]
For example:
int64_t i=[@"23570449442514" longLongValue];
You may use the atoll
function.
int64_t i = atoll([str UTF8String]);