2018年11月15日 星期四

[C語言]常用資料型別長度與範圍

參考微軟網站與其他網站資訊 將持續更新
類型名稱
位元組
其他名稱
值的範圍
int
4
signed
–2,147,483,648 2,147,483,647
unsigned int
4
unsigned
0 4,294,967,295
__int8
1
char
–128 127
unsigned __int8
1
unsigned char
0 255
__int16
2
shortshort intsigned short int
–32,768 32,767
unsigned __int16
2
unsigned shortunsigned short int
0 65,535
__int32
4
signedsigned intint
–2,147,483,648 2,147,483,647
unsigned __int32
4
unsignedunsigned int
0 4,294,967,295
__int64
8
long longsigned long long
–9,223,372,036,854,775,808 9,223,372,036,854,775,807
unsigned __int64
8
unsigned long long
0 18,446,744,073,709,551,615
bool
1
false true
char
1
預設為 –128 127
使用 /J 編譯時為 0 255
signed char
1
–128 127
unsigned char
1
0 255
short
2
short intsigned short int
–32,768 32,767
unsigned short
2
unsigned short int
0 65,535
long
4
long intsigned long int
–2,147,483,648 2,147,483,647
unsigned long
4
unsigned long int
0 4,294,967,295
long long
8
(但是相當於 __int64)
–9,223,372,036,854,775,808 9,223,372,036,854,775,807
unsigned long long
8
(但是相當於 unsigned __int64)
0 18,446,744,073,709,551,615
float
4
3.4E +/- 38 (7 位數)
double
8
1.7E +/- 308 (15 位數)
長雙精度
double 相同
double 相同
extend ascii
1
 
0 255
uint8_t
1
unsigned char
0 255
uint16_t
2
unsigned short int
0 65535
uint32_t
4
unsigned int
0 4294967295
 
 

10 則留言:

  1. 網誌管理員已經移除這則留言。

    回覆刪除
  2. 網誌管理員已經移除這則留言。

    回覆刪除
  3. We can instruct you properly, if you need to set up an HP wireless printer using 123.hp/setup . You can do the setup process easily, if you have correct technical knowledge about printer setup. First of all, you must go to open 123.hp/setup and open it in the internet browser. then , you should type the model number of your HP wireless printer in the shown box of 123.hp/setup. You can download the personal drivers of your HP wireless printer. After this process, you may get insert setting up the HP wireless printer properly. If you don’t have any manual or choice, you can take the specialized expert instruction or assistance for completing the setup process of HP wireless printer.

    回覆刪除