Added function to covert a vector to a c array.