A Problem About Reading a TXT File
ZeynepHarcanogl (0)

// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("decycling_5_ACGT.txt");
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
cout << line << '\n';
}
myfile.close();
}

else cout << "Unable to open file";

return 0;
}

Hello!
I am trying to read a file with using this code and my file is "decycling_5_ACGT.txt" its in my computer and when i paste the code and run it it says "Unable the run the file".
How can i fix thşs problem

You are viewing a single comment. View All
ZeynepHarcanogl (0)

@ZeynepHarcanogl i guess, i can fix this like what i did in replit right? if i can add the files maybe it can be solved