Re: 資料型態問題請教
|
||||
---|---|---|---|---|
資深會員
|
int 該是2byte 還是 4byte, 和所用的MCU/CPU有關,
並沒有應該是多少的問題 你的 "C語言教學手冊", 應該是電腦語言用的C吧 電腦至少也是32位元了 8bit環境和32biti環境規定的一定有所差異 只要遵照user manual上面寫的範圍即可
發表於: 2009/4/6 1:09
|
|||
|
資料型態問題請教
|
||||
---|---|---|---|---|
初級會員
|
在資料型態中,在下列兩本書中,光是int 為什麼位元組會不一樣呢?
讓我不明白當我定義 int a; <---這時a的範圍到底多少呢?? 每個單晶片都會有這種問題嗎???(混亂中) ============================= C語言教學手冊書中 long int 位元組:4 範圍:-2147483648 ~ 2147483647 int 位元組:4 範圍:-2147483648 ~ 2147483647 short int 位元組:2 範圍:-32768 ~ 32767 unsigned long int 位元組:4 範圍:0 ~ 4294967295 unsigned int 位元組:4 範圍:0 ~ 4294967295 unsigned short int 位元組:2 範圍:0 ~ 65536 ----------------------------------------------------------- 微處理器原理與應用(C語言與PIC18微控制器書中 int 位元組:2 範圍:-32768 ~ 32767 unsigned int 位元組:2 範圍:0 ~ 65535
發表於: 2009/4/3 23:14
|
|||
|