Vector implementation in C