Skip to content

Instantly share code, notes, and snippets.

@Nachiappan
Created June 10, 2010 10:10
Show Gist options
  • Save Nachiappan/432785 to your computer and use it in GitHub Desktop.
Save Nachiappan/432785 to your computer and use it in GitHub Desktop.
char *reverse(char *str1)
{
int leng1=0,i=0,j=0,midleng;
char temp;
leng1=leng(str1);// leng(str1) returns string length..
j=leng1-1;
midleng=leng1/2;
for(i=0;i<midleng;i++)
{
temp=str1[i];
str1[i]=str1[j];
str1[j]=temp;
j=j-1;
}
return str1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment