reference binding to null pointer of type 'struct value_type'错误分析

在左leetcode第30题时,出现报错(其实前面很多时候也有类似报错,但没有详细记录)
本题出现问题主要是当传入的words为空时,在后面执行words[0].length时的报错。
只要在前面加上特殊情况的判断即可。
更多情况参见下文。

https://blog.csdn.net/m0_38088298/article/details/79249044

猜你喜欢

转载自blog.csdn.net/m0_37887659/article/details/80722902
今日推荐