使用vector扩容制造bug

马角的逆袭 / 2023-05-07 / 原文

目录

    1. 原理:vector的push_back,resize会导致重新分配一块2倍capcity的内存,如果之前int* p=vec.data(),那么扩容后p将不可用