What code would I have to add to this to enable it to load a previously created file into the program...?
#include <iostream>
#include <fstream>
using namespace std;
main()
{
ofstream output;
output.open("file.txt");
output << "1 2 3 4";
output.close();
int var1, var2, var3, var4;
ifstream input;
input.open("file.txt");
input >> var1 >> var2 >> var3 >> var4;
input.close();
}
Thanks
-Chris