C is not allow like this
char *cp = "sample";
char carray[10] = cp;//NG, Type is different rather than that is not able to use the variables.
char carray[10] = "sample";// or { "test" };//OK
use strcpy (or strncpy)
E.g.
strcpy(carray, cp);