您的位置:首页 > 其它

一个弱智错误

2014-04-22 17:40 176 查看
今天写代码脑袋进水了,

void func()
{
int ret = 0;
INSTANCEImpl *ins = NULL;
if (*handle == NULL)
{
INSTANCEImpl *ins = new INSTANCEImpl;
}
else
{
doSomething();
}
ins->doOtherthing();
return ret;
}


第7行的INSTANCEImpl *应该去掉,

否则ins->doOtherthing();出错
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: