代码之家  ›  专栏  ›  技术社区  ›  Justin Dearing

在VisualStudio2008中是否有stoll()/walk()(string到long-long)替代方法

  •  2
  • Justin Dearing  · 技术社区  · 14 年前

    stoll() 对于Visual Studio 2008。即使安装windows 7 platform SDK也不会将stoll()添加到字符串头中。

    在unix上,可以调用相同的函数 strtoll() .

    2 回复  |  直到 14 年前
        1
  •  4
  •   Matthew Flaschen    14 年前

    你可以用 _strtoi64 stdlib.h .

    long long num = _strtoi64(str, NULL, 10);
    

    strtoll ,你可以通过 char ** endptr 作为第二个参数。如果是的话, *endptr

        2
  •  0
  •   thakis    6 年前

    VisualStudio2013添加了strtoll(),因此如果您可以依赖它,则可以直接使用strtoll()。