I am trying to build dynamic array with nested structs. When insert an item I am getting the following. error: incompatible types when assigning to type ‘struct B’ from type ‘struct B *’
What is the issue and where i am doing the mistake. Please help.
typedef struct {
size_t used;
size_t size;
struct B {
int *record1;
int *record2;
} *b;
} A;
void insertArray(A *a, int element) {
struct B* b = (struct B*)malloc(sizeof(struct B));
A->b[element] = b;
}