#include #include #include using namespace std; const MaxListSize = 1000; void printList(const char[], int); void getInput(char[], int, int&); void reverse(char[], int); int main() { char A[MaxListSize]; int ListSize; // get an array of chars getInput(A, MaxListSize, ListSize); cout << endl; printList(A, ListSize); cout << endl; // reverse it reverse(A, ListSize); cout << endl; printList(A, ListSize); cout << endl; // reverse it back to the original reverse(A, ListSize); cout << endl; printList(A, ListSize); cout << endl; getch(); return 0; } void printList(const char S[], int n) { cout << "["; for (int i = 0; i < n; ++i) { cout << " " << S[i]; } cout << " ]" << endl; } void getInput(char S[], int MaxN, int &n) { cout << "Enter a string: "; for (n = 0; (n < MaxN) && cin.get(S[n]) && (S[n] != '\n'); ++n) { continue; } } // YOU WRITE THIS FUNCTION void reverse(char S[], int size) { }