title: Is it a good idea to return " const char * " from a function?
body: <p>Now I have a function that has to return a string. I saw a particular implementation where he returns a const char * from the function.</p>
  
  <p>Something like this:</p>
  
  <pre><code>const char * GetSomeString() 
  { 
    ........   
    return somestlstring.c_str(); 
  }
  
  SomeOtherFoo ()
  {
    const char * tmp = GetSomeString();
    string s = tmp;
  }
  </code></pre>
  
  <p>Now I felt there is something potentially wrong with this. Is my gut feel right? or Is this a perfectly safe code?</p>
  
  <p>Kindly give me ur suggestions. I have a feeling return const char *  this way might result in havoc..</p>
  
  <p>Thanks, 
  Arjun</p>