2017年3月21日 星期二

c data type

資料型態

關鍵字位長範圍printf chars
char1-128..127 (或0..255,與體系結構相關) %c
unsigned char10..255
signed char1-128..127
int2
(Dos或win16)
or
4
(win32或unix)
-32768..32767


 or


-2147483648..2147483647
 %i, %d
unsigned int2
(Dos或win16)
 or
4
(win32或unix)
0..65535


or


0..4294967295
 %u
signed int2
(Dos或win16)
 or
4
(win32或unix)
-32768..32767


or


-2147483648..2147483647
 %i, %d
short int2-32768..32767 %hi
unsigned short20..65535 %hu
signed short2-32768..32767
long int4-2147483648..2147483647 %li, %ld
unsigned long40..4294967295 %lu
signed long4-2147483648..2147483647
long long8-9223372036854775808..9223372036854775807 %lli
unsigned long long80..18446744073709551615 %llu
float43.4x10-38..3.4x10+38 (7 sf) %f, %e, %g
double81.7x10-308..1.7x10+308 (15 sf) %f, %e, %g
long double8 或以上編譯器相關 %Lf, %Le, %Lg

https://msdn.microsoft.com/zh-tw/library/s3f49ktz.aspx

沒有留言:

張貼留言