Olá, estou com problemas com alocação dinamica e queria ajudar de vocês segue o tal
//representa a arvore
typedef struct{
int * nodeChildren;
char type;//b- black w-white grey g square s
int root;//is raiz? 1 is root 0 not is raiz
int isleaf;
int parent;
int parei;
}Node;
//representa a floresta
typedef struct{
Node * arvore;
int size_tree;
}Conteiner;
acima tenho as estruturas que estou usando
abaixo tenho um exemplo do que estou precisando fazer
Conteiner* compTree=malloc ((10) * sizeof (Conteiner));//armazem
compTree[0].arvore=malloc ((6)* sizeof (Node));
for ( i = 0; i < 5; ++i)
{
compTree[0].arvore.nodeChildren= calloc(4, sizeof(int));
}
Fico agradecido se alguém puder me ajuda o seguinte erro é retornado
incorrect checksum for freed object - object was probably modified after being freed.