Question: #2 (Print a String Backward) Write a recursive function stringReverse that takes a character array as an argument, prints it back to front and returns

#2 (Print a String Backward) Write a recursive function stringReverse that takes a character array as an argument, prints it back to front and returns nothing. The function should stop processing and return when the terminating null character of the string is encountered. Using Ubuntu would be best.

1] Do not change function names etc that has been given to you.

[2] Do not add additional libraries (i.e. for strings, and sorting), you need to do this yourself.

[3] Problems 1,2,3, must be done recursively. Thus, there shouldn't be any for/while loops. [4] To clarify the purpose of low and high in recursiveMinimum read the below:

#include #include #include #include

// Project Includes #include

#define SIZE_PROBLEM1 10 #define SIZE_PROBLEM2 30 #define SIZE_PROBLEM3 10 #define MAXRANGE_PROBLEM3 1000

#define SIZE_PROBLEM4 100

// // Functions

//////////////////////////////////////////////////////////////////////////////// // // Function : main // Description : The main function for the CMPSC assignment #1 // // Inputs : argc - the number of command line parameters // argv - the parameters // Outputs : 0 if successful test, -1 if failure

int main(int argc, char *argv[]) {

/////// Problem 2 Start ////////////////////////////////////// printf(" -------------------------------------------------------"); printf(" Problem 2 Start ");

// initialize string strArray char strArray[SIZE_PROBLEM2] = "Print this string backward.";

// display original string for (? ? ? ? ) { ? ? ? ? ); }

puts(""); stringReverse(strArray); // reverse the string puts(""); printf(" Problem 2 End");

/////// Problem 2 End //////////////////////////////////////

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!