Created
June 16, 2014 17:29
-
-
Save hilda8519/83237bb94060d14ab83f to your computer and use it in GitHub Desktop.
This file contains 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
#include <studio.h> | |
void swap(char* a, char* b) | |
void reserve(char* str) | |
void swap(char*a char*b){ | |
char* a=t; | |
a=b; | |
b=t; | |
} | |
void reserve(char* str){ | |
char* end=str; | |
char t; | |
if(str){ | |
while(*end)/*find the end of string*/ | |
end++; | |
} | |
else{ | |
end--; | |
} | |
while(str<end){ | |
t=*str; | |
*str++=*end; | |
*end--=t; | |
} | |
} | |
} | |
int main(){ | |
char array[]="helloworld"; | |
printf("reserve begin:%s/n", strArray); | |
reserve(strArray); | |
printf("reserve end: %s/n",strArray); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment