#include #include using namespace std; const size_t MAX_SIZE = 10; void LoadArray(string ary[], size_t MAX, string fileName, string destName); void PrintArray(const string ary[]); void ReversePrintArray(const string ary[]); // a global variable size_t size; int main() { string names[MAX_SIZE]; LoadArray(names, MAX_SIZE, "file1","A"); cout << "The array is " << endl; PrintArray(names); cout << endl; cout << "The reverse of the array is " << endl; ReversePrintArray(names); cout << endl; cout << "The array is " << endl; PrintArray(names); cout << endl; return 0; } void PrintArray(const string ary[]) { size_t i; for(i=0;i> tmp; while(inFile and size < MAX) { ary[size] = tmp; size++; inFile >> tmp; } if (inFile) { cout << "Load resulted in overflow, " << destName << " truncated."; cout << endl; } } return; }