[問題] *(UINT16*) 代表什麼意思

看板C_and_CPP作者 (亞斯拓)時間12年前 (2012/04/09 14:38), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Keil C 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): typedef unsigned short UINT16; typedef unsigned char UINT8; UINT8 omHeader[2]; UINT16 wMaxAppDataLength; omHeader[0]=0x11;omHeader[1]=0x22; wMaxAppDataLength = *(UINT16*)(&omHeader[0]); 請問 *(UINT16*)如何解釋 ? 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.251.190.44

04/09 14:43, , 1F
把 (&omHeader[0]) 轉成 (UINT16) 的 pointer 再拿出來
04/09 14:43, 1F

04/09 17:28, , 2F
大概是兩個8進位轉成16進位吧?
04/09 17:28, 2F

04/10 02:31, , 3F
學到一招了,感謝!
04/10 02:31, 3F
文章代碼(AID): #1FWeFdey (C_and_CPP)