Created
April 19, 2013 04:17
-
-
Save szolotykh/5418115 to your computer and use it in GitHub Desktop.
Merge two strings. Note: Don't forget to free memory after using function.
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
char* strmerge(char* str1, char* str2){ | |
char* str = (char*)malloc(strlen(str1) + strlen(str2) + 1); | |
strcpy(str, str1); | |
strcat(str, str2); | |
return str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment