Skip to content

Instantly share code, notes, and snippets.

@AlexanderBrevig
Created July 8, 2013 04:59
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 AlexanderBrevig/5946318 to your computer and use it in GitHub Desktop.
Save AlexanderBrevig/5946318 to your computer and use it in GitHub Desktop.
avoid multiple traversals of strings that is implied by using strcat
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