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.51hei.com/bbs/) | Powered by Discuz! X3.1 |