I have a question about the warning "assignment from incompatible pointer type". Why does the following code
const char files[][128]={"file1","file2","file3"};
char **ptr;
ptr=files;
produce this warning? Something more complex is working just fine:
typedef struct
{
double **matrix;
}foo_struct;
void fun(foo_struct *foo)
{
double **ptr;
ptr=(*foo).matrix;
}
So I can't really see why the first one does give this warning, because I thought that something like files[][128] is of the same type as char **ptr. The only difference I see is that C knows about the span/size of the valid memory region, whereas in the second example it doesn't.
Here's something similar, which didn't help me though: Warning about assignment from incompatible pointer type when using pointers and arrays?
Thank you for your help!