title: Why am I getting an incompatible pointer types error?
body: <p>I have studied C pointers, and am wondering why the compiler is issuing an incompatible pointer types error in the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  
  const char *months(int n);
  int main() {
      char **p = months(2);
  
      printf("%s", **p);
  }
  
  const char *months(int n) {
    const char *m[] = {
          "Invalid month",
          "January",
          "February",
          "March",
          "Aprli"
      };
      return (n == 0 || n &gt; 12) ? m[0] : m[n];
  }
  </code></pre>
  
  <p>I expect printf to display "February" as month, but I get that error 
  "Incompatible pointer types initializing 'char **' with an expression of type 'const char *'"
  during compile process .</p>
  
  <p>If not wrong months function return pointer to "n" month. Next I create a pointer p to point the result of months function.</p>
  
  <p>What is wrong here ?</p>