没怎么听懂你的意思,大致编了个,看是不是void replchr(char *s, char c1, char c2){ while (*s) { if (*s == c1) *s = c2; s++; }}