title: Returning a C string from a function
body: <p>I am trying to return a C string from a function, but it's not working. Here is my code.</p>
  
  <pre><code>char myFunction()
  {
      return "My String";
  }
  </code></pre>
  
  <p>In <code>main</code> I am calling it like this:</p>
  
  <pre><code>int main()
  {
    printf("%s", myFunction());
  }
  </code></pre>
  
  <p>I have also tried some other ways for <code>myFunction</code>, but they are not working. For example:</p>
  
  <pre><code>char myFunction()
  {
    char array[] = "my string";
    return array;
  }
  </code></pre>
  
  <p>Note: I am not allowed to use pointers!</p>
  
  <p>Little background on this problem:</p>
  
  <p>There is function which is finding out which month it is. For example, if it's 1 then it returns January, etc.</p>
  
  <p>So when it's going to print, it's doing it like this: <code>printf("Month: %s",calculateMonth(month));</code>. Now the problem is how to return that string from the <code>calculateMonth</code> function.</p>