【发布时间】:2011-12-06 15:17:24
【问题描述】:
谁能告诉我如何捕捉内存不足异常?
例如
try
{
while(true)
{
int i = new int;
}
}
catch( ? <--- what should be put here?)
{
//exception handling
}
还有这个,
queue<int> q;
try
{
while(true)
{
q.push(10);
}
}
catch( ? <---- what should be put here?)
{
//error handling
}
【问题讨论】:
-
@MooingDuck 我认为下面的答案比该问题的答案更适合每个有这个确切问题的人