I want to save the content of different files to a vector:
Vector(0) = Content File1
Vector(1) = Content File2
…
Later on I need to read out from each index of this vector line by line (getline):
getline(Vector(0), string myString)
As I read on different sites, I can’t use vector<istream> myVector.
So how can I solve?
It depends on the size of the data you want to manipulate. My two samples has been tested.
You can use a class which handles some raw pointers
Or a std::vector< std::vector< std::string > >. That’s a basic solution for small files but it works.