跪求大侠帮忙做下

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:52:12
Implement the standard function:function(char *fdestin, char *fsource,int fstart).which insce string to the destination string
at the given start index.

int function(char *fdestin, char *fsource,int nStart)
{
//{{ 判断
int nDesLen=0,nSouLen=0;
while(fdestin[nDesLen])
nDesLen++;
while(fsource[nSouLen])
nSouLen++;
if(nDesLen-nStart<nSouLen)
return 0;
//}}
//--Start here
fdestin+=nStart;
while(*fdestin!='\0'&&*fsource!='\0')
{
*fdestin=*fsource;
fdestin++;
fsource++;
}
*fdestin='\0'; //如果不是strcat,这句话可不要
return 1;
}