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';

else cout << "Unable to open file";

return 0;

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)

@mwilki7 oh, i see thank you very much! but i also want to test it on sublimetext, how can i do it?