求解关于字符串的移动,求大手
c语言吧
全部回复
仅看楼主
level 4
#include <stdio.h>
void fun( char *a )
{
int i=0;
char *p=a;
while(*p&&*p=='*')
{
a[i]=*p;
i++;
p++;
}
while(*p)
{
if(*p!='*')
{a[i]=*p;i++;}
p++;
}
a[i]='\0';
} main()
{ char s[81];void NONO ();
printf("Enter a string:\n");gets(s);
fun( s );
printf("The string after deleted:\n");puts(s);
NONO();
}
2012年03月12日 13点03分 1
level 4
谢谢了,不明白while两个函数*p的意思,
2012年03月12日 13点03分 2
level 4
*****AB***CD***EFG***之前的*号保留,其他的型号删去得到*****ABCDEFG
2012年03月12日 13点03分 3
level 4
while(*p&&*p=='*')
while(*p)
两个语句的意思,*p是*p!='\0'吗??
2012年03月12日 13点03分 4
level 4
怎么没人啊,我不是伸手党啊,是真不懂
2012年03月12日 13点03分 5
level 4
怎么没人看啊,偌大个贴吧
2012年03月12日 13点03分 6
1