ios:如何将NSString转换为int64_t? [英] ios: how to convert a NSString to int64_t?

查看:1307
本文介绍了ios:如何将NSString转换为int64_t?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 NSString 转换为 int64_t ,然后使用以下命令将其打印出来:

I want to convert a NSString to int64_t and then print it out using:

NSLog("%lld", i);

现在我只能使用 [str integerValue] 有时会打印出减号。

Now I can only convert using [str integerValue] which sometimes makes it print out the minus number.

推荐答案

你可以使用环礁 function。

You may use the atoll function.

int64_t i = atoll([str UTF8String]);

这篇关于ios:如何将NSString转换为int64_t?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆