//只删除字符串前面的‘*’号。
#include <stdio.h>
#include <conio.h>
#include <string.h>
void fun(char *a)
{
int i;
while(*a=='*')
{
i=0;
while(a[i]!=0)
{
a[i]=a[i+1];
i++;
}
}
}
main()
{
char s[81];
printf("Enter a string :\n");
gets(s);
fun(s);
printf("The string after deleted :\n");
puts(s);
strcpy(s, "*******A*BC*DEF*G****");
fun(s);
}
只删除字符串前面的‘*’号。
最新推荐文章于 2024-07-19 02:04:28 发布