本题要求编写函数,将输入字符串t中从第m个字符开始的全部字符复制到字符串s中。
函数接口定义:void strmcpy( char *t, int m, char *s );
函数strmcpy将输入字符串char *t中从第m个字符开始的全部字符复制到字符串char *s中。若m超过输入字符串的长度,则结果字符串应为空串。
void strmcpy( char *t, int m, char *s )
{
t=t+m-1;
while(*t!='\0'){
*s=*t;
s++;
t++;
}
*s='\0';
}