fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <string>
  5. using namespace std;
  6.  
  7.  
  8. int main () {
  9. string line;
  10. ifstream myfile ("tabelas.txt");
  11. if (myfile.is_open()){
  12. while (! myfile.eof() )
  13. {
  14. getline (myfile,line);
  15. string arq = "..\\dados\\"+ line+".csv";
  16.  
  17. ifstream obj (arq);
  18. if (!obj)
  19. cerr<<"Ocorreu um erro ao abrir o arquivo"<<endl;
  20. }
  21. myfile.close();
  22. }
  23.  
  24. else cout << "Unable to open file";
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Unable to open file