Should I use long long or int64_t for portable code?

后端 未结 3 2308
臣服心动
臣服心动 2020-12-15 03:03

I have an open-source codebase that is written in both C and C++. I\'m looking for an integer type that is guaranteed to be at least 64 bits wide, which can be reli

3条回答
  •  感动是毒
    2020-12-15 03:23

    Use int64_t. int64_t means 64 bits and you'll get 64 bits wherever you go. long long is actually as implementation dependent as long is. That is, a long long has to be bigger than or equal to a long, but that could be different depending on the compiler and platform.

提交回复
热议问题