Skip to main content
deleted 1 character in body
Source Link
haccks
  • 106.5k
  • 27
  • 181
  • 273

In the statement return arr;, arr will decay to pointer to an array of 10 chars, i.e. of type char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10]*arr[3] = {"hi", "bye", "cry"};   

or you can change the return type of the function to char (*)[10]

char (*func())[10] {...}

In the statement return arr;, arr will decay to pointer to an array of 10 chars, i.e. of type char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10] = {"hi", "bye", "cry"};   

or you can change the return type of the function to char (*)[10]

char (*func())[10] {...}

In the statement return arr;, arr will decay to pointer to an array of 10 chars, i.e. of type char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[3] = {"hi", "bye", "cry"};   

or you can change the return type of the function to char (*)[10]

char (*func())[10] {...}
added 106 characters in body
Source Link
haccks
  • 106.5k
  • 27
  • 181
  • 273

In the statement return arr;, arr will decay to pointer to an array of 10 chars, i.e. of type char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10] = {"hi", "bye", "cry"};   

or you can change the return type of the function to char (*)[10]

char (*func())[10] {...}

arr will decay to pointer to an array of 10 chars, i.e. char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10] = {"hi", "bye", "cry"}; 

In the statement return arr;, arr will decay to pointer to an array of 10 chars, i.e. of type char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10] = {"hi", "bye", "cry"};   

or you can change the return type of the function to char (*)[10]

char (*func())[10] {...}
Source Link
haccks
  • 106.5k
  • 27
  • 181
  • 273

arr will decay to pointer to an array of 10 chars, i.e. char (*)[10] while return type of your function is char **. Both pointer types are incompatible.
You can change the type of arr in the declaration from array of arrays to array of pointers.

static char *arr[10] = {"hi", "bye", "cry"};