Created
November 23, 2012 19:06
-
-
Save Aaron1011/4136867 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
int reverse(char s[]) | |
{ | |
int len, i; | |
char copied[MAXLINE]; | |
copy(copied, s); | |
for (len = 0; ; ++len) | |
if (s[len] == '\n') | |
break; | |
for (i = 0; i <= len; ++i) | |
if (copied[i] == '\n') | |
break; | |
s[len - i] = copied[i]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment