Wie kann ich mehrere FILE Objekte in einem Vector speichern?
#include <iostream> #include <vector> #include <cstdio> std::vector<FILE> files; int main() { files.push_back(fopen("test.txt", "w")); fclose(files[0]); return 0; }
Du kannst FILE Pointer in einem std::vector speichern.
#include <iostream> #include <vector> #include <cstdio> std::vector<FILE*> files; int main() { files.push_back(fopen("test.txt", "w")); fclose(files[0]); return 0; }