读书人

烦劳大伙看看小弟我这递归为什么Unhan

发布时间: 2012-07-20 10:38:30 作者: rapoo

烦劳大伙看看我这递归为什么Unhandled exception at Stack overflow.
出现了Unhandled exception at Stack overflow.的错误

C/C++ code
//COctree *m_pOctreeNodes[8] 是COctree  的一个成员COctree* COctree::FindVoxel(COctree * o, double x, double y, double z){   if (m_bSubDivided)   {       for (int i = 0; i< 7; i++)       {           if (m_pOctreeNodes[i]->BoundVictory(x, y, z) && m_pOctreeNodes[i]!= NULL)           {               FindVoxel(m_pOctreeNodes[i], x, y, z);               //break;           }       }   }   else if (!m_bSubDivided && m_pVertices)   {       return this;   }}



[解决办法]
一般指过程函数递归层数过多导致栈溢出

读书人网 >C++

热点推荐