I\'m trying to find a way to make a struct to hold a dynamic array that can work with any data type (Including user defined data types), so far this is what I came up with.<
Vector(DATATYPE) struct { DATATYPE* data; size_t size; size_t used; } also fails for pointers to functions.
void* is sufficient and well defined for a pointer to any object, but not so for a pointer to a function.
C does allow a pointer to a function of one type to be saved as a pointer to a function of another type. By using a union of the two below, code has enough space for saving the pointer to any type. The management of what type and what member used remains open.
union u_ptr {
void *object;
void (*function)();
}