C语言中在Unix和Windows上均可使用的64位整数(uint64_t)的atoi等效项是什么? [英] What is atoi equivalent for 64bit integer(uint64_t) in C that works on both Unix and Windows?

查看:91
本文介绍了C语言中在Unix和Windows上均可使用的64位整数(uint64_t)的atoi等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将64位整数字符串转换为整数,但是我不知道要使用哪个字符串.

I'm trying to convert 64bit integer string to integer, but I don't know which one to use.

推荐答案

使用 strtoull (如果有)或 _strtoui64() 与Visual Studio.

Use strtoull if you have it or _strtoui64() with visual studio.

unsigned long long strtoull(const char *restrict str,
       char **restrict endptr, int base);


/* I am sure MS had a good reason not to name it "strtoull" or
 * "_strtoull" at least.
 */
unsigned __int64 _strtoui64(
   const char *nptr,
   char **endptr,
   int base 
);

这篇关于C语言中在Unix和Windows上均可使用的64位整数(uint64_t)的atoi等效项是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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