Created
July 8, 2013 04:59
-
-
Save AlexanderBrevig/5946318 to your computer and use it in GitHub Desktop.
avoid multiple traversals of strings that is implied by using strcat
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
void str_append_from(char *original, int &idx, const char *append) { | |
while (*append) { | |
original[idx++] = *append++; | |
} | |
original[idx] = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment