#include<stdio.h>
#include<assert.h>
char my__strcpy(char*dest, const char *src)
{
assert(dest != NULL);
assert(src);
while (*src != ‘\0‘)
{
*dest = *src;
dest++;
src++;
}
*dest = ‘\0‘;
}
int main()
{
char arr1[30];
char *arr2 = { "student a am i" };
ret=my__strcpy(arr1, arr2);
printf("%s\n", arr1);
system("pause");
return 0;
}
时间: 2024-10-05 10:25:21