// Program to open (and close) an input file and print the (integer) // values found in the file stream until end-of-file (i.e., until no // more numbers to be read). #include #include using namespace std; int main() { ifstream inputFile; // Input file object int number; inputFile.open("/nfshome/untch/public_html/2170/public/prices.dat"); inputFile >> number; while (inputFile) { cout << number << endl; inputFile >> number; } cout << "No more input data. Stopping." << endl; inputFile.close(); return 0; }