I have two arrays of pointers that I need to allocate memory to, but I am having problems when casting them. The code seems to be working fine, but is giving me
warning: assignment from incompatible pointer type [enabled by default]
These are the types and mallocs codes:
typedef struct Elem Elem;
struct Elem {
char *(*attrib)[][2]; //type from a struct
Elem *(*subelem)[]; //type from a struct
}
Elem *newNode;
newNode->attrib = (char*)malloc(sizeof(char*) * 2 * attrCounter);
newNode->subelem = (Elem*)malloc(sizeof(Elem*) * nchild);