c++ new bad_alloc

try
{
  for (int i = 0; i<1000; i++)
  {
    test1 = new Test();
    cout << i << " new dog success..." << endl;
  }
}
catch (bad_alloc err)
{
  cout << "fail:"<<err.what()<< endl;
}

 

posted @ 2019-06-08 19:22  西北逍遥  阅读(524)  评论(0编辑  收藏  举报