gpt4 book ai didi

c++ - 在 Unix 和 Windows 上都可以使用的 C 中 64 位整数(uint64_t)的 atoi 等价物是什么?

转载 作者:IT老高 更新时间:2023-10-28 12:44:48 29 4
gpt4 key购买 nike

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

最佳答案

使用 strtoull如果你有它或_strtoui64()与 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 上都可以使用的 C 中 64 位整数(uint64_t)的 atoi 等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7502926/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com