// A UDF to copy a String
#include <stdio.h>
#include <conio.h>
void stringcopy(char[],char[]);
void main()
{
clrscr();
char x[20];
char y[20] = "Aquib Mir";
stringcopy(x,y);
printf("X is %s",x);
getch();
}
void stringcopy(char s[20],char t[20])
{
int i = 0;
while(t[i] != '\0')
{
s[i] = t[i];
i++;
}
s[i] = '\0';
}
How has 'y' been copied to 'x'? Because I performed the operation in my own finction, not in main.?// A UDF to copy a String #include <stdio.h>