I am trying to achieve something in C and hope you guys can tell me where I went wrong.
So I have values that is an array of 6 const char pointers.
int main()
{
/* values is an array of 6 char pointers */
const char *values[6] =
{
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
};
/* p is a pointer to a char pointer */
char *(*p) = &values[0];
}
What I am doing here is to create p that is a pointer to a char pointer from my array and store the address of the first char pointer in my array into p.
Though the logic works, I keep getting a warning message saying:
warning: assignment from incompatible pointer type
What am I doing wrong?