首页 > 其他 > 详细

bug of vetor

时间:2015-02-01 17:49:50      阅读:122      评论:0      收藏:0      [点我收藏+]
#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

原文:http://blog.csdn.net/u011495472/article/details/43372211

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!