Function that simulates a vector in C