错误描述: Line 20: Char 21: runtime error: member access within null pointer of type ‘TreeNode’ (solution.cpp) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:29:21 这种情况是由于判断条件不完整造成的,要完善条…
记录本算法小白刷力扣的这道题遇到的报错
349. 两个数组的交集https://leetcode.cn/problems/intersection-of-two-arrays/
出现报错的代码
/*** Note: The returned array must be malloced, assume caller calls free().*/
int* intersection(int* nums1, int nums1Size,…
去官网查下这个警告就知道解决办法了
https://docs.microsoft.com/en-us/cpp/code-quality/c6011?viewmsvc-170&viewFallbackFromvs-2019
“To resolve the issue, validate the pointer before use.”:使用前验证下就ok了
if(pointerNULL).......