[問題] struct 強制轉換
在 android code 裡常看到強制轉換
一個 struct sensors_module_t{
struct hw_module_t common;
int (*abc)();
}
而在a程式宣告 sensor dule_t mSensorModule;
然後就直接call hw_get_module(*, (hw_module_t**)&mSensorModule)
hw_get_module 的原型是 hw_get_module(const char*,hw_module_t**)
這樣做強制轉換在c來講有甚麼用意嗎?
謝謝。
--
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.220.69.181
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1467869390.A.D9F.html
※ 編輯: gn00618777 (61.220.69.181), 07/07/2016 13:31:36
※ 編輯: gn00618777 (61.220.69.181), 07/07/2016 13:31:59
推
07/07 14:15, , 1F
07/07 14:15, 1F
→
07/07 15:55, , 2F
07/07 15:55, 2F
→
07/07 15:55, , 3F
07/07 15:55, 3F
→
07/07 17:42, , 4F
07/07 17:42, 4F
推
07/08 07:58, , 5F
07/08 07:58, 5F
推
07/08 12:25, , 6F
07/08 12:25, 6F
→
07/08 12:26, , 7F
07/08 12:26, 7F
→
07/08 12:31, , 8F
07/08 12:31, 8F
→
07/08 12:37, , 9F
07/08 12:37, 9F
→
07/08 12:37, , 10F
07/08 12:37, 10F
→
07/09 09:57, , 11F
07/09 09:57, 11F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章