I am writing a dynamic array in C.
typedef struct __c_array {
void**_elem;
int cur_size;
int capacity;
}c_array;
My Interface look like this:
extern void push_back_c_array ( c_array*, void *);
Now user will have to allocate memory for the element to be pushed into the array . Is there any way to avoid this using void *.
I want use this to do following
int a = 5;
push_back_c_array ( <ARRAY_PTR>, a );
Is this possible.