int main() { char s1[] = "antidisestablishmentarianism"; char s2[] = "aie"; squeeze2(s1, s2); printf("%s\n", s1); }
int main() { char string[] = "abbccaaccdda"; char remove[] = "ab"; squeeze2(string, remove); printf("%s\n", string); }
int main() { char s1[] = "amigoooo"; char s2[] = "oi"; squeeze2(s1, s2); return 0; }
int main(void) { char s1[LENMAX]; char s2[LENMAX]; printf("Enter the source string (the string from which characters are to be deleted)\n"); fgets(s1, LENMAX, stdin); printf("Enter the string of characters that are to be deleted from the source string\n"); fgets(s2, LENMAX, stdin); squeeze2(s1, s2); printf("After deletion, the source string becomes whatever is in the double quotes:\n\"%s\"\n", s1); return 0; }
int main(void) { char s1[MAX]; char s2[MAX]; int a, b,d; a = b = 0; printf("\nEnter a string (100 char max): "); a = getline(s1); /* get the chars to remove */ printf("\nEnter the characters to remove: "); b = getline(s2); squeeze2(s1,a, s2, b); return 0; }
int main(void) { char *leftstr[] = { "", "a", "antidisestablishmentarianism", "beautifications", "characteristically", "deterministically", "electroencephalography", "familiarisation", "gastrointestinal", "heterogeneousness", "incomprehensibility", "justifications", "knowledgeable", "lexicographically", "microarchitectures", "nondeterministically", "organizationally", "phenomenologically", "quantifications", "representationally", "straightforwardness", "telecommunications", "uncontrollability", "vulnerabilities", "wholeheartedly", "xylophonically", /* if there is such a word :-) */ "youthfulness", "zoologically" }; char *rightstr[] = { "", "a", "the", "quick", "brown", "dog", "jumps", "over", "lazy", "fox", "get", "rid", "of", "windows", "and", "install", "linux" }; char buffer[32]; size_t numlefts = sizeof leftstr / sizeof leftstr[0]; size_t numrights = sizeof rightstr / sizeof rightstr[0]; size_t left = 0; size_t right = 0; for(left = 0; right < numlefts; left++){ for(right = 0; right < numrights; right++){ strcpy(buffer, leftstr[left]); squeeze2(buffer, rightstr[right]); printf("[%s] - [%s] = [%s]\n", leftstr[left],rightstr[right],buffer); } } return 0; }