赞
踩
Line 7: Char 9: runtime error: index 30 out of bounds for type 'int [30]' (solution.cpp) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:16:9
数组越界,把int[30]改成int[31]
C++ requires a type specifier for all declarations dp[0]=0;
翻译:
c++要求所有声明都有类型说明符
没彻底理解,但是知道了解决方法
出错原因: 代码片段没有写在函数中。
解决方法: 将代码片段写进函数中。
runtime error: addition of unsigned offset to 0x602000000010 overflowed to 0x60200000000c (stl_vector.h)
翻译:
无符号偏移量从0x602000000010溢出到0x60200000000c (stl_vector.h)
解决:
避免数组下标小于0
reference binding to null pointer of type 'int' (stl_vector.h)
翻译:引用绑定到类型为int的空指针
原因:在声明vector容器的时候没有指定大小,但是在用的时候当作指定了大小的数组用了。
解决:
用push_back
runtime err
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。