i have a doubt with passing array as a argument to function, my code as below,
#include <stdio.h>
#include <string.h>
void str_cpy(char a[], char b[])
{
a = b;
printf("%s\n", a);
}
int main()
{
char a[] = "hello";
char b[] = "world";
str_cpy(a, b);
printf ("%s\n", a);
return 0;
}
In the above code i am passing array to function is pass by reference so it should print "world" in the main function because i am assigning value of b to a i.e a = b in the function definition but it is not , so please help me ..
C.