An implementation of a vector / dynamic array in c