#include <fstream>
using namespace std;
int main ( ) {
int a, b, c ;
ifstream fin ; //Create file input stream object
fin.open ( "my_input.dat") ; //Open input file
fin >> a >> b ; //Read two values from input file
c = a + b ;
ofstream fout ; //Create file output stream object
fout.open ( "my_output.dat"); //Open output file
fout << c << endl ; //Write result to output file
fin.close ( ) ; //Close input file
fout.close ( ) ; //Close output file
}
|