Is there an alternative, either built into windows or apache license compatible, to stoll() for Visual Studio 2008. Even installing the windows 7 platform SDK does not add stoll() to the string header.
On unix the sam开发者_高级运维e function is be called strtoll().
You can use _strtoi64
. It's declared in stdlib.h
.
long long num = _strtoi64(str, NULL, 10);
Similarly to strtoll
, you can pass a char ** endptr
as a second parameter. If so, *endptr
will be set to the first invalid character (which may be the normal null-terminator).
Visual Studio 2013 added strtoll(), so if you can depend on that you can use strtoll() directly.
精彩评论