Hi,
I want to provide the type of an element as parameter to an initialization of an array of pointers to element of an unknown types
something like
void* init(type t)
void* array = malloc(sizeof_type(t)*10));
return array;
}
and later call for example
init(typeof(int))
But I was not able to figure what is the return type of typeof.
I guess the sizeof_type think can be achieved using
malloc((type) 0);
Thanks in advance
PS: this if for a vector implementatin if someone can point me to some flexiblecode i would be very thankful as well