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 ^^
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.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.