698_____________________________________________ 12

dup  dup2,     , -
    , ,  
.          14   14.12.4.

12.9.3  /      C++

12.9.3.1    

 C++     /:

ifstream	   
ofstream	   
fstream	    

           -
, , ,      
        ()  
  ().

  ,   ,  -
 . , 

ofstream outfile("Test.dat");

if(!outfile)

(
ShowMessage("   ");

return;

)

   outfile,    Test.dat,  -
   ,    ,     . 
        ,  outfile 
,   if  .

    ,   :

ifstream infile("Test.dat");

if(!infile)

(
ShowMessage("   ");

return;

}

         
 ()     (),     11  
11.7.14.   ,    , 
        -
      . ,
,  :

int i = 1, j = 25, il, jl;

double a = 25e6, al;

char s[40], si [40];

strcpy(s,"") ;

//     
ofstream outfile("Test.dat");

if(!outfiie)
(

ShowMessage("   ");

return;

}