-
-
Save Nachiappan/432785 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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