c语言求助

    技术2022-05-19  21

    /*编写函数 int DelAla(char *str),函数功能:删除str中的字母字符,并返回删除字符个数。写主函数,验证你的DelAla函数的正确性。*/ #include #include char DelAla(char *str); void main ( ) { char *a; scanf("%s",a); DelAla(a); printf("%s",a); } char DelAla(char *str) { int i,j,k=0; char *p; p=str; for(i=0,j=0;str[i]!='/0';i++) { if(isalpha (str[i])) { j++; continue; } else p[k++]=str[i]; } return (p); } 哪里错了


    最新回复(0)