推 mosquito520:用if不行嗎? 09/15 23:52
→ l1l1l1l1:if 二個都可以 只是想學學switch case~~ 09/15 23:57
推 mosquito520:這是電子版 就不回文章了 09/15 23:59
→ mosquito520:ANSI C Standard: The switch statement 09/16 00:00
→ mosquito520:The controlling expression of a switch statement 09/16 00:00
→ mosquito520:shall have integral type. 09/16 00:00
→ Schottky:把 data type 轉換成 int 就可以了, 不能直接用 bit 09/16 12:13
→ Schottky:因為 switch-case 翻譯成組合語言時是用查表法 09/16 12:13
→ Schottky:話說 C51 & Keil C 好像沒有適合的看板可以去 09/16 12:15
→ Schottky:ASM 板是歡迎 Keil C, 但是在 ASM 看到 C 我會以為走錯板 09/16 12:16
推 mosquito520:查表?這我不確定,我倒沒去探討, 09/17 17:46
→ mosquito520:至於KeilC適合去哪個板,我想這個板跟C語言板都可以吧 09/17 17:47
→ mosquito520:不回文指是因為這個問題是純粹的語法問題,跟硬體無關 09/17 17:48
推 sopi:單bit只有1與0 何須用到switch.. switch多用於無先後的判斷 09/18 03:06
推 mosquito520:樓上,Switch要注意先後順序的喔~ 09/18 17:40
謝謝樓上各位
※ 編輯: l1l1l1l1 來自: 123.193.205.245 (09/18 20:43)