#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;
}
原文地址:http://10942013.blog.51cto.com/10932013/1727371