网站首页
编程语言
数据库
系统相关
其他分享
编程问答
pdPoint
2024-07-17
避免函数形参为空指针
展示一个函数形参为空指针的隐患:执行第32行代码时,相当于执行double*pdPoint=pdTemp;,由于pdTemp=NULL,所以pdPoint=NULL。在然后 voidPointer(double*pdPoint,intiDim)函数中对pdPoint赋了一块动态内存,此时 pdPoint!=NULL,但是 pdPoint和pdTemp只是赋值