samedi 18 janvier 2020

How to create vectors dynamically in C++

I am trying to initialize vectors depending upon user input. Suppose if user provide n=4 then i have to create 4 vectors of varying sizes. As for vectors syntax is :

vector v1(x);

So, similarly i want to create v2,v3 and v4 named vectors.

Please advise a solution for this. I am confused.

Aucun commentaire:

Enregistrer un commentaire