I'd like to pass an array of pointers of structure addresses which has varying size and access structure members. But by passing the array of structure objects the data is irregular and library functions are giving SIGABRT signal. This is a part of my code-
struct data *device_info;
device_info = malloc(device_count*sizeof(void );
ipbt_database_manager_get_device_info(device_info, "all", device_count);
This is the function definition-
bool ipbt_database_manager_get_device_info(struct data *dev_info_ptr, char *device_id, int device_count)
{
struct node *current_device_info = first_device_info;
int count = 0;
if (!strcmp(device_id,"all")) {
while (current_device_info != NULL) {
dev_info_ptr[count] = current_device_info->node_data;
count++;
current_device_info = current_device_info->next;
}
}
sizeof(void)is supposed to give you?sizeof(struct data)