i have to write a small funtion that modifes a string by replacing every occurence of the letters foo by aaa. an example of the string is "food fool" and should become "aaad aaal". i've written this function and i just want to know if i got it right because i'm not that good when it comes to functions. thanks
Code:void censor(char s[]) { int i; for(i=0; s[i]!='\0'; i++) if (s[i]=='f' && s[i+1]=='o' && s[i+2]=='o') s[i]=s[i+1]=s[i+2]='a'; return a; }