1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】14.指针2/6-1 使用函数实现字符串部分复制.c

13 lines
206 B
C

void strmcpy(char *src, int begin_idx, char *dst) {
int len = strlen(src);
begin_idx--;
for (int i = begin_idx; i < len; i++) {
*dst = src[i];
dst++;
}
*dst = '\0';
}