how to reverse a string in cpp without using string function code example
Example: reverse string efficient in cpp without using function
#include <iostream>
using namespace std;
int main()
{
char str[] = "Reverseme";
char reverse[50];
int i=-1;
int j=0;
/*Count the length, until it each at the end of string.*/
while(str[++i]!='\0');
while(i>=0)
reverse[j++]=str[--i];
reverse[j]='\0';
cout<<"Reverse of a string is"<< reverse;
return 0;
}