[Solved] Malloc , Realloc , Memset : Struct pointers , arrays of char, int


Error was in v_push_back implementation :

v->e_array = check_a(memcpy((void*)((char*)v->e_array + (v->no_e * v->e_sz)) ,new_val, v->e_sz)); //pointer has not to be saved

 check_a(memcpy((void*)((char*)v->e_array + (v->no_e * v->e_sz)) ,new_val, v->e_sz));

Because memcpy returns a pointer , in this case, to the last element of the array so we would have lost access to all previous memory

solved Malloc , Realloc , Memset : Struct pointers , arrays of char, int