#include <iostream>
#include <fstream>
usingnamespace std;
int main()
{
constint ARRAY_SIZE = 100;
int numbers[ARRAY_SIZE];
int count = 0;
ifstream inputFile;
inputFile.open("numbers.txt");
while ( count < ARRAY_SIZE && inputFile >> numbers[count] )
count++;
inputFile.close();
return 0;
}
I don't understand exactly what inputFile >> numbers[count] is doing. I understand its reading in the numbers from the file and assigning them to each element in the array, but I don't really understand what its doing in the condition list. If ARRAY_SIZE is the maximum iteration of the loop, what's the purpose of the inputFile condition? Any help will be greatly appreciated.