Array vector implementation in C