Skip to content

Instantly share code, notes, and snippets.

@raychen
Created August 26, 2010 09:38
Show Gist options
  • Save raychen/551145 to your computer and use it in GitHub Desktop.
Save raychen/551145 to your computer and use it in GitHub Desktop.
char* strcat(char *a, char *b) {
while (*a++);
a--;
while (*a++ = *b++);
return a;
}
char *str_a = "a string";
char *str_b = "a long long long string";
char *str_c = "yet another string";
char *result;
result = strcat(str_a, str_b);
result = strcat(result, str_c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment