C++ program works with vectors, C program works with arrays