Cross-platform primitive data types in C++

前端 未结 7 2486
鱼传尺愫
鱼传尺愫 2021-02-14 07:04

Unlike Java or C#, primitive data types in C++ can vary in size depending on the platform. For example, int is not guaranteed to be a 32-bit integer. Various compi

7条回答
  •  猫巷女王i
    2021-02-14 07:30

    If its name begins with two underscores (__), a data type is non-standard.

    __int8 (unsigned __int8)

    __int16 (unsigned __int16)

    __int32 (unsigned __int32)

    __int64 (unsigned __int64)

    Try to use boost/cstdint.hpp

提交回复
热议问题