Created
June 21, 2017 19:44
-
-
Save Yangff/b81027e3fad94dbb9062da50fb90347c to your computer and use it in GitHub Desktop.
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 del_substr(char *str, const char *substr) { | |
char *c1, *c2; | |
while (*str++!=0) { | |
for (c1 = str, c2 = (char*)substr; *c1 == *c2 && *c1 && *c2; c1++, c2++); | |
if (*c2 == 0) | |
for (c2 = str; *c2++ = *c1++; ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment