Advertisement
snakemelon

leecode代码注意事项

Jan 25th, 2021 (edited)
40
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 错误已经解决,函数中的* returnSize 指明了返回数组或者字符串的长度,不仅需要返回数组指针,还需要赋值给 * returnSize
  2. 例如函数int* sortedSquares(int* nums, int numsSize, int* returnSize)
  3. nums 是传入数组的指针, numsSize是nums数组的长度,
  4. 这时在返回数组指针时需要给*returnSize 赋值: *returnSize = numsSize;
Advertisement
RAW Paste Data Copied
Advertisement