![]() |
#2
自学的数学2020-02-18 18:22
|
//从第n个字符开始复制
char *my_strncpy(char *dest, char *t, int n)
{
char *str = dest; //用指针str来操作
while (n&&*t != '\0') {
*dest = *t;
++*dest, ++*t;
n--;
}
return str;
}
&& 两个一起是什么意思
能不能只判断 t != '\0'