2014-01-17 77 views
0

unsigned long long應該是什麼確切的typedef
例如:什麼應該是無符號long long的確切大小

typedef unsigned int uint32 ; //考慮我的機器讀
typedef unsigned char byte ;

那麼,什麼是

typedef unsigned long long ______ ;

它是uint64或超過這個?

+3

無。它的大小不固定爲一個值。它的最小尺寸只有一個要求。 – juanchopanza

+0

在大多數編譯器上有8個字節(64位)。 –

+0

'typedef unsigned long long int \t uint64_t' –

回答

0
unsigned long long my_variable; 

裝置my_variable是64個比特(或多個)

的無符號整數值可能會發現helpfult這個太:

How many bytes is unsigned long long?

unsigned long long 

是一個synonim

unsigned long long int 

被定義,作爲

typedef unsigned long long int uint64_t 

看到

Standard Integer Types

+0

'unsigned long long int'沒有被定義爲'uint64_t'。 'uint64_t' _may_可以被定義爲'unsigned long long int',反過來並不由C指定。 – chux

1

unsigned long long是保證大小至少爲64位。因此,它等價於uint_least64_t

的typedef無符號長長uint_least_64_t

+0

在給定當前平臺的情況下,它們通常是等價的。一個深奧的/未來的C兼容平臺可能具有「無符號長整型」,如128位無符號和無符號長整型,如64位無符號。這樣的系統不能用'typedef unsigned long uint_least64_t;'來保持等價。 – chux

相關問題