CodePudding user response:
Can use the basic C fopen () function fgets fclose
# include & lt; Stdio. H>
Void main (void)
{
The FILE * stream;
Char line [100].
If ((stream=fopen (" the fgets. C ", "r"))!=NULL)
{
If (the fgets (line, 100, stream)==NULL)
Printf (" the fgets error \ n ");
The else
Printf (" % s ", line);
The fclose (stream);
}
}
CodePudding user response:
Don't compile,,,,,,,CodePudding user response:
CStdioFile txtIn;if(! TxtIn. Open (TransFile, CFile: : modeRead |
CFile: : typeText | CFile: : shareDenyNone))
{
AfxMessageBox (" unable to open file!" );
return;
}
Cstrings OneLine.
While (txtIn. ReadString (OneLine))
{
OneLine. Empty ();
}
TxtIn. Close ();
CodePudding user response:
According to the text file processing