【问题标题】:How to get access to new c++11 standard sized types? [duplicate]如何访问新的 c++11 标准大小类型? [复制]
【发布时间】:2012-12-15 11:01:48
【问题描述】:

我所说的类型显示在此处的第 3 页: http://dl.dropbox.com/u/13100941/C%2B%2B11.pdf

int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t

我正在使用 Visual Studio 2012。如果它与 GNU/Mingw 不同,请包括如何在这些编译器上获取它们。

【问题讨论】:

    标签: c++ c++11


    【解决方案1】:

    您需要包含<cstdint>。它适用于任何符合 C++11C99 的编译器。

    对于那些<cstdint> 不可用或损坏的编译器,有Boost.Integer

    【讨论】:

    • @AshRj:适用于任何符合 C++11C99 的编译器
    • 请注意,提供这些类型对于编译器来说完全是可选的
    【解决方案2】:

    您可以简单地使用自 2010 版以来在 MSVC 中的 #include <cstdint>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-07
      • 2017-11-13
      • 2017-08-02
      • 2016-12-21
      • 1970-01-01
      • 2010-10-10
      • 2012-09-28
      • 1970-01-01
      相关资源
      最近更新 更多