line 3
edges[0] = arr;
incompatible types in assignment: arr
is a char *
and edges[0]
is a int *
.
What happens is this:
int *edges[500];
char arr[] = {'c','d'};
arr[0] is 'c' and arr[1] is 'd'
edges[0] = arr;
Ignoring the type compatibility, edges[0] point to the int
at the address where the 'c' and 'd' (and possibly two more unspecified characters) are.
printf("%c %c", edges[0][0],edges[0][1]);
edges[0][0] is the first integer in edges[0]: that's the mix of 'c', 'd' (and possible two more unspecified characters). That value is converted to unsigned char, yielding 'c' which gets printed.
edges[0][1] points to the integer right after the mix of 'c', 'd' (and possibly two more unspecified characters). That memory location has not been initialized and it may well be outside the range your process can access.
if you print an int instead of 2 chars
printf("%d\n", edges[0][0]);
you will see the mix of 'c', 'd' (and possibly two unspecified characters).
Best thing to do is get your types right.