void my_strcpy

#include<stdio.h>
void my_strcpy(char *dest,const char *str)
{
	while (*str!='\0')
	{
		*dest=*str;
		dest++;
		str++;
	}
}
int main()
{
	char p[]="asdasd";
	char *q="zxczxc";
	my_strcpy(p,q);
	printf("%s\n",p);

}

你可能感兴趣的:(void my_strcpy)