Thread: Ctrl-V
View Single Post
Old 03-15-2004, 09:20 PM   #707 (permalink)
WarWagon
Loser
 
#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
}
WarWagon is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45