我这程序到底哪里写错了
char *convert(char *dest){
char *head=dest;
char *ss=dest;
char *src={0};
while(*dest)
{
if(*dest!=':')
{
dest++;
}
else
{
head=dest;
dest--;
while((*dest != ':')&&(strcmp(dest,ss)!=0))
{
*src=*dest;
src++;
dest--;
}
dest=head;
dest++;
}
}
return src;
}
int main()
{
char *s="ab:cd";
printf("%s\n",convert(s));
}