    C++__________________________________689

ftinclude <stdio.h>

FILE *F;

if ((F = fopen("Test.txt", "rt")) == NULL)
{

ShowMessage("   ");

return;

}

...         //   

fclose(F); //  

   F       
Test.txt,      .    
 (,   ),    .

       .  -
       fclose(F).

    

fopen("Test.txt", "rt+")

          ,   
   .

          .
    fgets:

char *fgets(char *s, int n, FILE *stream) ;

   s    ,    , n 
  .        -
    \ (    ),  
n  1 .       .

,      Memol    -
    :

char s [80] ;

Memol->Clear() ;

do
(

fgets(s,80,F) ;

if(feof(F)) break;

if(s[strlen(s)-l] == '\n') s[strlen(s)-l] = 0;

Memol->Lines->Add(s) ;

}
fclose(F); //  

 fgets   .  feof ,  -
    .     feof  
   .     ,  

if(s[strlen(s)-l] == '\n') s [strlen(s)-1] = 0;

    ,     
.    ,    \   -
   Memol.       .

       
 fscanf.

int fscanf(FILE *stream, const char *format[, address, ...]);

  format    , 
 .       14  -
 14.4.2.   ,        