#include<stdio.h>
char* cpy(char *a,char *b)
{
char *arr;
arr=&a; // Error
while((*a++=*b++)!='\0');
printf("%s", arr);
}
int main()
{
char s[15]="Sreeja";
char t[15]="Mukherjee";
cpy(&s,&t);
}
Error:
A single pointer cannot hold an address of a pointer, you would need a double pointer for that. However, here, all you want is to store the address to which pointer 'a' is pointing to. This is needed because it is going to be incremented and you need that for printing (and of course returning).
To store that address which is pointed by 'a', into another pointer 'arr', this is sufficient
arr=a;