// imgmain.cpp -- Main program for satellite images. #include "image.h" #include #include #include void print_images(image data[], int num_images); int main() { ifstream in_file; image data[25]; int num_images = 0; char file_name[20], line[81]; // Get the file name from the user, and open that file for reading. cout << "What is the name of the input file? "; cin >> file_name; in_file.open(file_name); assert (! in_file.fail()); // Read the individual lines of code, and initialize a new // image object for each line of data. while (1) { in_file.getline(line, 81); if (in_file.eof()) break; image new_image (line); data[num_images++] = new_image; // put new image in array } // Time for the output. print_images(data, num_images); return 0; } // This function prints the array of satellite images. // You will need to modify it to produce a header and also // a line of dashes immediately above the table being printed. void print_images (image data[], int num_images) { for (int i = 1; i < num_images; ++i) cout << data[i]; }