What is atoi equivalent for 64bit integer(uint64_t) in C that works on both Unix and Windows?
问题 I'm trying to convert 64bit integer string to integer, but I don't know which one to use. 回答1: 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 ); 回答2: You've tagged this question c++, so I'm assuming you might be interested in C++