i think that you must return x[] to then main() function
see my code below.

Code:
#include <stdio.h>
#include <stdlib.h>

char * squeez(char [],char []);

char * squeez(char s[],char z[]){
    int i,j,found,count=0;
    char *x=NULL;
    for (i=0;s[i];i++){
        found=1;//we suppose that this char-->s[i] is not in second string
        for (j=0;z[j];j++){
            if (s[i]==z[j]){//if this char-->s[i] exists in second string then we supposed wrong!
                found=0;//this char-->s[i] is not good because it exists in second string
                break;//we found a wrong value so stop searching the rest of second string for s[i]
            }
        }
        if (found==1){//yes we found one that not exists in second string
            count++;//increase counter
         x=(char *) realloc(x,count*sizeof(char));  //alocate memory for it
         x[count-1]=s[i]; //store it in x[]
        }

    }
    return x;//return x[] to the main()
}

int main(){
    char first[]="abcdabcdabcdfghfghabcdabcd";//string to test
    char sub[]="abcd";    //string with the chars to delete
    char * x=squeez(first,sub);//call function and get result
    printf("\n    string=<%s>",first);
    printf("\nsub  chars=<%s>",sub);
    printf("\nresult is x[]=<%s>",x);
    getchar();
    return 0;    
}

Last edited by virxen; 30Mar2010 at 12:02..