• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 資料型態問題請教
#3
資深會員
資深會員


查看用戶資訊
引述 K&R:「an integer, typically reflecting the natural size of integers on the host machine.」,「...free to choose appropriate sizes..., subject only to restriction that shorts and ints are at least 16bits...」

實務以 limits.h 內容為準。

發表於: 2009/4/6 13:33
The Answer to Life, the Universe, and Everything.
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 資料型態問題請教
#2
資深會員
資深會員


查看用戶資訊
int 該是2byte 還是 4byte, 和所用的MCU/CPU有關,
並沒有應該是多少的問題

你的 "C語言教學手冊", 應該是電腦語言用的C吧
電腦至少也是32位元了
8bit環境和32biti環境規定的一定有所差異
只要遵照user manual上面寫的範圍即可

發表於: 2009/4/6 1:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


資料型態問題請教
#1
初級會員
初級會員


查看用戶資訊
在資料型態中,在下列兩本書中,光是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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------