Home > Back-end >  C open TXT file to read the string
C open TXT file to read the string

Time:12-09

Can someone help me have a look at this code?
I want to read TXT file in English, but why read is empty?
//create the input stream
String fname;
Int len=0, len1=0;
String STR, str1 [100], str2;
Int k=1, j=0;
Int num=0;
Cout & lt; <"Please enter to open the file name:" & lt; cin> Fname;
Ifstream ist (fname);
if (! Ist. Is_open ())
{
Cout & lt; <"File open failed" & lt; return 0;
}

//getline (ist, STR);
While (getline (ist, STR))
Len++;
Ist. Close ();

CodePudding user response:

I can, you don't have to see,

CodePudding user response:

Congratulations to solve, pick up points,
  • Related