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

标签 c++ c atoi

我正在尝试将 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/

相关文章:

c++ - 关联容器的 lower_bound 复杂度 : member function vs non-member function

c++ - atoi 与整数和 double

c - K&R atoi-一般内存泄漏

c++ - 无法在boost库中使用property_map和compressed_sparse_row_graph

c++ - C++ 将对象的内容写入文件

c++ - std::transform 可以替换为 std::accumulate 吗?

C 编程堆栈

这个阿克曼函数的实现可以称为尾递归吗?

c - 具有用于 EAP-TLS 的原始套接字的 OpenSSL

c++ - 如何判断 c 函数 atoi 是否失败或是否是一串零?