Question: Hi, I am not sure how to do this problem of reversing the strings. I need help on it and could you comment it as

Hi, I am not sure how to do this problem of reversing the strings. I need help on it and could you comment it as well so i know what is going on. Thank you so much. // Problem 5: reverseStrings (15 points) // Reverse the string s and print it, by using pointers. // Use pointer p and 'temp' char to swap 1st char with last, then 2nd char with (last-1) and so on.. // Finally print the reversed string at the end of this function // Hint: You might want to check if your logic works with even as well as odd length string. void printReversedString(char s[STRING_LENGTH]) { char temp; // not necessary to use this variable char *p = &s[0]; // pointer to start of string } 

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!