i have this error:
ID3.c:71:53: error: incompatible types when assigning to type ‘t_object’ {aka ‘struct object’} from type ‘t_object *’ {aka ‘struct object *’} 71 | (objects->v[sizeof(void *) * i]) = t_object_ctor(); | ^~~~~~~~~~~~~
i tried this:
&(objects->v[sizeof(void *) * i]) = t_object_ctor();
and tried this
*(objects->v[sizeof(void *) * i]) = t_object_ctor();
and this gives the same error
*((objects->v)+[sizeof(void *) * i]) = t_object_ctor();
this is the funcion the error is in: t_objects *t_objects_ctor(){ t_objects *objects =malloc(sizeof(t_objects));
objects->size = 0;
objects->y = 0;
objects->x = 0;
objects->x_size= malloc(sizeof(size_t) * RESONABLENUMBER);
objects->v= malloc(sizeof(void *) * RESONABLENUMBER);
for (int i = 0; i < RESONABLENUMBER; ++i) {
*((objects->v) + sizeof(void *) * i) = t_object_ctor();
}
objects->b_size = 0;
objects->b = NULL;
return objects;
}
this is the function im assigning pointers from:
t_object *t_object_ctor(){
t_object *object =malloc(sizeof(t_object));
object->s = 0;
object->x = NULL;
object->y = 0;
return object;
}
objectsist_object * objects[]then it should just beobjects[i] = t_object_ctor();