Added example 5-14. Sorts data from stdin. Has some issues.
[C-Programming-Examples.git] / ex_2-4.c
blob59f3be1e91245f9b646f0a1d14c53a6c52693b2b
1 /*
3 Delete each char in string test that matches any char in string key.
5 Returns indication of found match
7 */
9 #include <stdio.h>
11 #define FALSE 0;
12 #define TRUE 1;
14 char key[] = "abc";
15 char test[] = "abc123";
17 int squeeze(char test[], char key[])
19 int t,k,x;
20 for(k = 0; test[k] != '\0'; k++)
22 x = TRUE;
23 for(t = 0; key[t] != '\0'; t++)
25 if(test[k] == key[t]){ x = FALSE; }
27 if(x == 1) { putchar(test[k]); }
29 printf("\n");
30 return x;
33 int main()
35 squeeze(test, key);
36 return 0;