how to read integers from file and write each integer into different name integer?
- by Aivaras
This is how the program looks and i need to make all integers with different name. Like x,x1,x2 and so on...
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream iFile("input.txt"); // input.txt has integers, one per line
while (true) {
int x;
iFile >> x;
if( iFile.eof() ) break;
cerr << x << endl;
}
system("Pause");
return 0;
}