Question about C Pointers (just learning)
- by Mike
I am curious as to why this is an error and what the error message means. Here is some code.
int *x[] = {"foo", "bar", "baz"};
int *y[] = {"foo", "bar", "baz"};
x = y;
I try to compile and I get this:
error: incompatible types when assigning to type ‘char [3]’ from type ‘char *’
Question #1 why is this an error? and Question #2 why are the types different?
Thanks for you help.