How to implement reversestring() function with const char *string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to implement reversestring() function with const char *string

I’ve been trying to figure out how to implement a reversestring() function with the following function call: char * reversestring(const char *string) { } I haven’t had any luck, any help?

15th Feb 2022, 8:50 PM
Taylor Cameron
Taylor Cameron - avatar
3 Answers
+ 1
Take a character array. Use a loop to assign array characters from indexes strlen(string) -1 to 0 into new array from 0 to strlen(string) Return new character array...
15th Feb 2022, 9:18 PM
Jayakrishna 🇮🇳
+ 1
I managed to solve this problem now, thank you Jayakrishna🇮🇳 https://code.sololearn.com/c40qidPeqJby/?ref=app
17th Feb 2022, 12:02 AM
Taylor Cameron
Taylor Cameron - avatar
0
you're welcome... Taylor Cameron Edit: Use int main(){
17th Feb 2022, 6:42 PM
Jayakrishna 🇮🇳