#include "stdafx.h" #include <cassert> #include <cstring> void del(char * str1, const char * str2) { assert(str1); assert(str2); int count[256] = {0}; for(int i=0;i<strlen(str2);i++) count[str2[i]-'\0']++; char * fast =str1, *slow=str1; int len = strlen(str1); for(int i=0;i<len;i++) { if(count[str1[i]-'\0'] == 0) { *slow = *fast; slow++; } fast++; } *slow='\0'; } int _tmain(int argc, _TCHAR* argv[]) { char str[] = "aerou"; char str2[] = "aeiou"; del(str,str2); printf("%s\n",str); return 0; }