C: Incompatible types?
- by Airjoe
#include <stdlib.h>
#include <stdio.h>
struct foo{
int id;
char *bar;
char *baz[6];
};
int main(int argc, char **argv){
struct foo f;
f.id=1;
char *qux[6];
f.bar=argv[0];
f.baz=qux; // Marked line
return 1;
}
This is just some test code so ignore that qux doesn't actually have anything useful in it.
I'm getting an error on the marked line, incompatible types when assigning to type ‘char *[6]’ from type ‘char **’ but both of the variables are defined as char *[6] in the code. Any insight?