replace 썸네일형 리스트형 [C언어] 문자열 치환함수 출처 : http://mwultong.blogspot.com/2006/10/c-string-replace-all.html char *replaceAll(char *s, const char *olds, const char *news) {char *result, *sr;size_t i, count = 0;size_t oldlen = strlen(olds); if (oldlen < 1) return s;size_t newlen = strlen(news); if (newlen != oldlen) {for (i = 0; s[i] != '\0';) {if (memcmp(&s[i], olds, oldlen) == 0) count++, i += oldlen;else i++;}} else i = strlen(s); re.. 더보기 이전 1 다음