申请内存失败的话,那么程序可能会直接报错。 此时可以加上nothrow关键字,如int *a=(std::nothrow)int[10000] 之后再判断if(a==nullptr)就可以了
点赞 评论

相关推荐

牛客网
牛客企业服务