In a hypothetical scenario, I don't know how many items are the file. What kind of a loop would I use to read the items in the file until the file ends? Code I'm currently working with is below.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream inputFile;
int num;
inputFile.open("TenNos.txt");
cout << "Reading data from the file. \n";
inputFile >> num;
cout << num << endl;
return 0;
}