Which C datatype can represent a 40-bit binary number?

后端 未结 4 1647
说谎
说谎 2020-12-04 02:04

I need to represent a 40-bit binary number. Which C datatype should be used to handle this?

4条回答
  •  既然无缘
    2020-12-04 02:26

    You can use long long, which can contain 64 bits or more. For more information, see

    http://en.cppreference.com/w/cpp/language/types

    http://en.wikipedia.org/wiki/Integer_(computer_science)#Common_long_integer_sizes

    Define the 64 bit width integer in Linux

提交回复
热议问题