[Solved] Using Malloc() to create an integer array using pointer [closed]

It can be inferred from the error message, intarr_create(): null pointer in the structure’s data field, that data fields of each struct are expected to be allocated. intarr_t* intarr_create(size_t len){ intarr_t* ia = malloc(sizeof(intarr_t) * len); size_t i; for(i = 0; i < len; i++) { // ia[len].len = 0; // You can initialise the … Read more