int *pi = malloc(sizeof(int));
用C语言可以,但用C++语言会编译出错。
在C++语言中,应该这样使用。
int *pi = (int*) malloc(sizeof(int));
C和C++语言中的malloc函数有什么区别?
相关文章:
ios - React native Pod 安装得到权限被拒绝
javascript - 使用 filter() 而不是 map() 来修改对象数组?
reactjs - 配置多个下一个插件 : withMDX, withBundleAnalyzer
python - 导入错误 : No module named 'typing' when tryi
email - SendGrid Automated Security 如何处理 SPF 记录?
perl - 什么意思 "Can' t locate object method.."在这个使用 P
asp.net-core - 如何在 ASP.NET Core 3.1 中为 Swagger 指定默