How about a 1 Liner:
OrCode:#include<stdio.h> int main() { char fooBar[] = "Charlotte*NC*is*a*really*cool*place*to*work*and*play"; char *p; for(p=fooBar; *p ; p++ ) if (*p=='*') *p = ' '; printf("%s\n",fooBar); }
Code:p = fooBar; while(p=strchr(p,'*') ) *p++='*';