Q:

returning pointer to a pointer in c

I'm trying to return a pointer to a pointer from a function.
I have the following function
char **foo() {
 const char **bar;
 ...
 return bar;
}

and I get the following warning:
warning: return from incompatible pointer type [enabled by default]

what am I missing?

A:

You can't jsut cast away the const qualifier like that. It points to pointers to const chars. You can however:
 const char **foo() {
   const char **bar;
   ...
   return bar;
  }

