void squeez(char s,char z);
char s = "Hey wassup !!!!!!";
char z = "Wow cool!!!!!";
void squeez(char s , char z)
int j,dummy = 0,i=0;
for(j = 0 ; s[j] != '\0';j++)/* the starting loop */
while(z[i] != '\0') /* inner loop */
/* the purpose of dummy is to tell weather this if statement became true or not */
if(s[j] = z[i])
dummy = 123;
if(dummy != 123)
x[j] = s[j];
printf("%s",x); /* printing out the values */
The main aim of making this program is that :-
1. This program/function will delete all those characters in the first string i.e s that matches any character in the second string i.e z . And copy the new string of characters to x.
The program is not giving the right output it is printing some garbage value.
Help me with this piece of code . Tell me where i am wrong and what is the solution.
Thank you IN advance.