well today for 1000-th time i learned that file streams are not file pointers and that a vector of fstreams is not allowed.
ok, so i guess i get that now, non the less i still need a solution to a following problem:
I need to write to multiple files and the number of files are not known in advance that is I know them only when i process some data. Moreover the writing is not dome consecutively (first write in file 1 then in file 2 ....) but as i am processing something i get a number that tels me to which file it should be written.
so what would be an alternative (C++ alternative) to :
I could convert streams to file pointers and then proceed but is there a better way ?Code:std::vector<std::fstream> outFiles_fs(x); std::vector<std::vector<std::fstream>> outFile2dArray_fs(y,outFiles_fs);