#include <stdio.h>
const int LEN = 256;
void Delete(char* first, char* second)
{
int i;
int hashtable[LEN] = {0};
char *p = second;
while (*p) {
hashtable[*p] = 1;
p++;
}
char *FastP = first;
char *SlowP = first;
while (*FastP) {
if (!hashtable[*FastP]) {
*SlowP++ = *FastP;
}
FastP++;
}
*SlowP = '\0';
}
int main()
{
char a[] = "They are students";
char b[] = "aeiou";
Delete(a,b);
printf("%s\n",a);
return 0;
}
const int LEN = 256;
void Delete(char* first, char* second)
{
int i;
int hashtable[LEN] = {0};
char *p = second;
while (*p) {
hashtable[*p] = 1;
p++;
}
char *FastP = first;
char *SlowP = first;
while (*FastP) {
if (!hashtable[*FastP]) {
*SlowP++ = *FastP;
}
FastP++;
}
*SlowP = '\0';
}
int main()
{
char a[] = "They are students";
char b[] = "aeiou";
Delete(a,b);
printf("%s\n",a);
return 0;
}