fork download
  1.  
  2. #include <iostream>
  3. #include <iostream>
  4. #include <fstream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. int main () {
  9. string line;
  10. ifstream myfile ("elect12.csv");
  11. if (myfile.is_open())
  12. {
  13. while ( getline (myfile,line) )
  14. {
  15. cout << line << '\n';
  16. }
  17. myfile.close();
  18. }
  19.  
  20. else cout << "Unable to open file";
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Unable to open file