Hi everybody,
I just start lerning C
I'v heard a lot about pointers but not really sure were to put them.
(or may be I'm wrong may be I just made some mistake) pls take a quic look.
/* This program will delete all simbols
* from s1 that s2 contains
*
*
*/
#include<stdio.h>
#define SIZE 100
void squeeze(char s1[], char s2[]);
int main() {
char s[SIZE] = "Hi my name is Sean, I like C, and I really like girls";
char j[SIZE] = "replace";
printf(s + '\n');
squeeze(s, j);
printf(s + '\n');
return 0;
}
char squeeze(char s1[], char s2[]) {
int i=0;
int j=0;
for(i=0; i<s1; i++) {
for(j=0; j<s2 && s2[j]!='\0'; j++) {
if(s1[i]==s2[j])
s1[i]=' ';
}
return s1[i];
}
}