eyesrglazed
Programmer
I am now trying to write some code that reads and writes to files in a loop.
I want this to work in a loop, but the reading marker for the inFile doesn't reset itself (go back up to the beginning of the file). Can anyone help me?
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream inFile;
ofstream outFile;
inFile.open("temp.dat");
.
.
//Grab strings
inFile.close();
outFile.open("results.dat");
.
.
//Write strings
outFile.close();
return 0;
}
I want this to work in a loop, but the reading marker for the inFile doesn't reset itself (go back up to the beginning of the file). Can anyone help me?