本文介绍了为什么malloc返回Void Pointer?/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么malloc返回void指针?
因为我们可以将任何数据类型强制转换为任何其他数据类型,那么如果malloc返回int类型指针,那么我们也可以将它转换为另一个数据类型指针,那么为什么返回void指针?
Why malloc return void pointer?
Because we can typecast any data-type into any another data type,then if malloc return int type pointer then also we can typecast it into another data type pointer,then why return void pointer?
推荐答案
这篇关于为什么malloc返回Void Pointer?/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!