Skip to content

Instantly share code, notes, and snippets.

@unknowntpo
Created February 18, 2020 06:00
Show Gist options
  • Save unknowntpo/ce429d33bec4e07342019c10490c19c4 to your computer and use it in GitHub Desktop.
Save unknowntpo/ce429d33bec4e07342019c10490c19c4 to your computer and use it in GitHub Desktop.
/* copy t to s ; pointer version 2 */
void strcpy(char *s, char *t) {
while (*s++ = *t++)
;
}
/* copy t to s ; pointer version 1 */
void strcpy(char *s, char *t) {
while ((*s++ = *t++) != '\0')
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment