char *p[10];
char *a = (char*)p;
Is not right (that's why you needed to add the cast)
char* p[10]
creates an array of ten character pointers,
char *a
creates a character pointer.
In order to load the value of
p
into
a
, it needs to be a
char**
:
char *p[10];
char **a = p;