title: "Life-time" of a string literal in C
body: <p>Wouldn't the pointer returned by the following function be inaccessible?</p>
  
  <pre><code>char *foo(int rc)
  {
      switch (rc)
      {
          case 1:
  
              return("one");
  
          case 2:
  
              return("two");
  
          default:
  
              return("whatever");
      }
  }
  </code></pre>
  
  <p>So the lifetime of a local variable in C/C++ is practically only within the function, right? Which means, after <code>char* foo(int)</code> terminates, the pointer it returns no longer means anything, right?</p>
  
  <p>I'm a bit confused about the lifetime of a local variable. What is a good clarification?</p>