In the main function, input one string and pass it to a function named cleanString. This function removes the non-alphabetic characters and writes the rest into a new character array (i.e. non-alphabetic characters are +, - ?, *, 1,2,3,…). After receiving a cleaned array, you should call another function named reverseWords. This function takes and returns the string as a parameter. String should be arranged in a reversed order for each word. All operations in this function should take place on the same string, you shouldn’t be using a temporary array for the reverse operation. Finally, print the result in the main function.
Sample run:
Enter first string: This-?=*is__12the**23%third?[]homework--_?().
Comments
Leave a comment