代码:
#include <stdio.h>
void funDel(char *str)
{
    int i, j;
    for (i = j = 0; str[i] != '\0'; i++)
        if (str[i] != 'f' && str[i] != 'F')
            str[j++] = str[i];
    str[j] = '\0';
}
int main()
{
    char str[100];
    printf("请输入一个字符串:");
    gets(str);
    printf("原字符串:");
    puts(str);
    funDel(str);
    printf("删除后的字符串:");
    puts(str);
    printf("\n\n");
    // system("pasuse");
    return 0;
}
运行程序键盘输入 aFc
结果:
简单流程:
a F c \0
a c c \0
a c \0
相当于 将非f或者非F的值向前移动 覆盖 f或者F的值 再在字符串最后添加\0



















