关于字符串数组问题
我想请教字符串数组的问题,1、如何把字符串数组里某个字符去掉?如 char *a[100]={"认定对手"};去掉定字。
程序代码:#include<stdio.h>
int main(void)
{
char *a[1]={"认定对手"};
char **p=a;
char *p2=a[0];
char t[]="定";
bool flag=1;
int index=1;
while(*p[0]!='\0')
{
if(*p[0]++==t[0] && *p[0]==t[1])
{
flag=0;
break;
}
p[0]++;
index++;
}
p[0]--;
p2=p[0];
p[0]++;
p[0]++;
if(flag==0)
{
printf("%s\n",p2);
printf("%s\n",p[0]);
}
return 0;
}我只能做到找到该字符 但是替换不了 貌似常量字符串 具体的咋弄就不清楚了
