bug of vector

来源:互联网 发布:海贼王883知乎 编辑:程序博客网 时间:2024/05/22 08:29
#include <vector>int main(){//    freopen("in","r",stdin);    vector<int>  a;    a.clear();    a.push_back(1);    for(vector<int>::iterator it = a.begin();it!=a.end();++it){        if(*it<100) a.push_back(*it*2);    }}
 The code will make segmentation fault , I think It's the designer's fault
0 0