I'm trying to create an array of empty string vectors, but I can't manage to initialize the vectors to be able to push values into them:
vector <string> v;
// vector initializing code
v.push_back("hello"); // should work now
'v' does not name a type
As pointed in all the comments on your question, your error occurs because you wrote your code out of a
main function. Each C++ program must have it.
By the way, here are good practices for free (found also in comments).
std::arrayinstead of C-array if you know the size at compile-time (and I believe you do).
using namespace std;because it's bad.
#include <array>if using-so.