I haven't been writing C for very long, and so I'm not sure about how I should go about doing these sorts of recursive things... I would like each cell to contain another cell, but I get an error along the lines of "field 'child' has incomplete type". What's up?
typedef struct Cell {
int isParent;
Cell child;
} Cell;
Clearly a Cell cannot contain another cell as it becomes a never-ending recursion.
However a Cell CAN contain a pointer to another cell.
typedef struct Cell {
bool isParent;
struct Cell* child;
} Cell;