leetcode遇到的错误

各种内存错误

AddressSanitizer: stack-overflow on address 0x7fff4d466ff8 (pc 0x0000004122c9 bp 0x7fff4d467030 sp 0x7fff4d466ff0 T0)
这种一般是系统栈溢出了,可能是因为无限递归导致的,应该检查一下递归条件是不是不合适。

runtime error: reference binding to misaligned address 0xbebebebebebec0ba for type ‘int’, which requires 4 byte alignment (stl_deque.h)
0xbebebebebebec0ba: note: pointer points here

指针乱指!例如栈为空时调用top()函数,会导致越界报错

stack<int> s;
s.top();    //这样会导致编译出错

函数错误

发布了17 篇原创文章 · 获赞 2 · 访问量 1585

猜你喜欢

转载自blog.csdn.net/lubxx/article/details/104925341