I have two dynamically allocated arrays. c
char **a = (char**)malloc(sizeof(char*) * 5));
char **b = (char**)malloc(sizeof(char*) * 5));
for (int i = 0; i
They are different. In strcpy() case you are copying the characters, in the assignment case you adjust the pointer to point to the same array.
a[0] -> allocated memory containing "hello"
b[0] -> allocated memory not yet initialised
After b[0] = a[0]
both now point to same memory
a[0] -> allocated memeory containing "hello"
b[0] ---^
and worse nothing now points to b[0]'s
allocated memory not yet initialised
so you can never free it; memory leak.