Recursive Reverse String Algorithm
The Shortest function to reverse a string.
*/
#include <iostream>
using namespace std;
void ret_str(char* s)
{
if(*s != '\0')
ret_str(s+1);
cout<<*(s);
}
int main()
{
ret_str("born2c0de");
return 0;
}
Mobile Technology | Programming | Data Structure | C++ | Java |
Copyright © 2009 by Learn Technology
Template by Blogger Templates | Powered by Blogger
Comments :
0 comments to “Recursion Shortest Function to Reverse a String”
Post a Comment