模拟实现strcpy
#include<stdio.h>
#include<Windows.h>
#include<assert.h>
char *my_strcpy(char q[], char *p)
{
assert(q);
assert(p);
char *s = q;
while (*q++ = *p++);
*q = '\0';
return s;
}
int main()
{
char *p = "sasdnakmvl";
char q[54];
printf("%s\n", my_strcpy(q, p));
system("pause");
return 0;
}
模拟实现strcpy
最新推荐文章于 2022-04-11 19:04:04 发布