writing_to_file

writing_to_file - infile.close outfile.close...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // writing_to_file #include <iostream> #include <fstream> using namespace std int main() { int length = 0 int width = 0 ifstream infile("C:/Temp/data1.txt") ofstream outfile("C:/Temp/results1.txt") infile >> length infile >> width outfile << length * 2 + width * 2 << endl //****************************************
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: / infile.close() outfile.close() // *************************************** infile.open("C:/Temp/data2.txt") infile >> length infile >> width outfile.open("C:/Temp/results2.txt") outfile << length * 2 + width * 2 << endl return 0 }// end of main...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online