心理

當前位置 /首頁/完美生活/心理/列表

int佔幾個位元組,unsigned

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個位元組

TAG標籤:unsigned int 位元組 #