if take array it will be fine but as i used *str1 and str2 it does not work
#include <stdio.h>
void copystr(char* ,char*);
int main()
{
char *str1="xxx";
char *str2= "yyy";
copystr(str1, str2);
printf("\n %s",str2);
}
void copystr(char *dest,char *src)
{
while(*src!='\0')
*dest++=*src++;
*dest='\0';
return;
}