any idea to reverse string without using strrev() function in C?
*Just only use stdio.h to complete scoure code
Thank you for your idea ^^
Printable View
any idea to reverse string without using strrev() function in C?
*Just only use stdio.h to complete scoure code
Thank you for your idea ^^
Well, there is no strrev() function in the C standard library in the first place ;)
Use or replicate strlen() to find the length of the string, and then swap the corresponding nth and (length - n - 1)th chars in a loop that stops halfway through the string.
Erm,can give some example?i didn't understand what u try to explain. XD
So how much of it DO you understand. Can you read a string? Can you figure out it's length? Do you understand how to get the nth character out of a string?
--
Mats