为什么我在以下代码中出现分段错误?
struct Cell
{
cellMode mode;
bool visited;
//bool scanned;
int rowIndex;
int colIndex;
Cell *neighbours;//if using Cell neighbours[3] i am getting a compilation error
Cell()
{
neighbours = new Cell[3];//seg fault here
}
};
当我使用静态数组时,出现以下错误
neighbours has incomplete type