First off, that won't compile because
copyarraystringto
returns a char rather than a pointer.
char *copyarraystringto(char Ac[], char A2c[])
You pass parameters to your function:
char copyarraystringto(char Ac[], char A2c[]);
...
printf("%s", copyarraystringto(A, A2));
But you don't use them:
char copyarraystringto(char Ac[], char A2c[])
{
strcpy(A2, A);
return A2;
}
So you copy the empty global string A2 into the full global string A and then return it - so you print an empty string.
Use the parameters instead:
char *copyarraystringto(char Ac[], char A2c[])
{
strcpy(A2c, Ac);
return A2c;
}
And it'll work.
But please, use sensible variable names! It makes code a lot easier to read and work with later...
char copyarraystringto(char source[], char dest[])
{
strcpy(source, dest);
return dest;
}