generic vector imitation in C