Skip to content

Instantly share code, notes, and snippets.

@hilda8519
Created June 16, 2014 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hilda8519/83237bb94060d14ab83f to your computer and use it in GitHub Desktop.
Save hilda8519/83237bb94060d14ab83f to your computer and use it in GitHub Desktop.
#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