Hephaestus 發表于 2024-3-19 00:33
我用mingw_w64 13.0編譯你的代碼,只有warning沒有error,你用的是什么編譯器?
keyway 發表于 2024-3-19 21:03
為什么 void Disp(ST_t *Ptr) 無法取 const 資料??
該如何改比較正確?
Hephaestus 發表于 2024-3-19 22:17
-fpermissive
Downgrade some required diagnostics about nonconformant code from errors to warnings ...
keyway 發表于 2024-3-21 00:03
出現error的原因是C++設計的比C更加安全,它不能自動的將void *轉換為其它指針類型
解決方法:CFLAGS = ...
1600277881 發表于 2024-3-21 11:30
調用時轉換一下就行了
Disp((ST_t*)&BBVal);
歡迎光臨 (http://www.raoushi.com/bbs/) | Powered by Discuz! X3.1 |