首页 > 代码库 > bug of vetor

bug of vetor

#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

bug of vetor