unsigned - int佔幾個字節

來源:魅力女性吧 1.24W
unsigned int佔幾個字節

機器字長及編譯器有關係: 所以,int,long int,short int的寬度都可能隨編譯器而異。

但有幾條鐵定的原則(ANSI/ISO制訂的): 1 sizeof(short int)<=sizeof(int) 2 sizeof(int)<=sizeof(long int) 3 short int至少應為16位(2字節) 4 long int至少應為32位。 unsigned 是無符號的意思。

例如: 16位編譯器 char :1個字節 char*(即指針變量): 2個字節 short int : 2個字節 int: 2個字節 unsigned int : 2個字節 float: 4個字節 double: 8個字節 long: 4個字節 long long: 8個字節 unsigned long: 4個字節

熱門標籤