// John Bent's CS 110 Hand-out 13 // Batch processing - file IO // // reads values from one file and writes them to another // if you try this, make sure you have a data file in the // current directory // // This program does NO error checking for whether the // file actually exists. #include #include int main() { ifstream input("data"); ofstream output("results"); int x, y, z; input >> x >> y >> z; // echo print to see if you read x, y and z OK cout << "x = " << x << " y = " << y << " z = " << z << endl; // print to file output << "the ints are:\n" << x << " " << y << " " << z << "\n\n"; return 0; }