c++ 学习 娱乐 数据结构 Visual Studio报错解决: a value of type “void *“ cannot be assigned to an entity of type “int *“ - 您收到此警告是因为 VS 是不合格的编译器,或者因为您正在将代码编译为 C++
a value of type "void *" cannot be assigned to an entity of type "int *"
->arrary = malloc(sizeof(int) * 10)
malloc 代码没问题。您收到此警告是因为 VS 是不合格的编译器,或者因为您正在将代码编译为 C++。如果将VS设置为C模式编译后问题依然存在,请换一个更好的编译器。
通过强制转换更改解决: 拼多多帮助力入口
->arrary = (int *)malloc(sizeof(int))
精彩文章