Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started