Question: Only Correct answer will be rate. (12 pts) Write a function called reverseString (), which uses a Stack to reverse a C string (char). The

Only Correct answer will be rate.

Only Correct answer will be rate. (12 pts) Write a function called

(12 pts) Write a function called reverseString (), which uses a Stack to reverse a C string (char). The string that is to be reversed is passed in as a parameter. The function should reverse the characters in the string (i.e. "cat" becomes "tac") and return a pointer to the reversed string. A second string or array should NOT be used to reverse or store the characters. The Stack supports the following member functions: bool push (char c)i // adds c to the top of the stack bool Pop char // removes the character at top of stack and // parameter c bool isEmpty returns true if stack is empty; false otherwise The function header and Stack object instantiation has been supplied for you below: char reversestring (char *pstr) Stack theStack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!