Hi there!
Sorry for the rather simple question, I rarely ever code in plain C.
But essentially, I have something that looks like this:
Code:
// This is malloc'd and initialized somewhere, I promise!
static char **somestrings = NULL;
const char **getsomestrings(void)
{
return somestrings;
}
The compiler throws a warning at me "returning ‘char **’ from a function with incompatible return type ‘const char **’"
Is it safe to just cast this like so:
Code:
return ( const char** )somestrings;
Or is there a legitimate reason the return type is considered "incompatible"?