title: deque push back error
body: <p>I am writing a compiler and use deque to store methods labels of a class and here's the sample code:</p>
  
  <pre><code>#include &lt;deque&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using std::cout;
  using std::deque;
  using std::endl;
  using std::string;
  
  int main()
  {
    deque&lt;const char *&gt; names;
  
    string prefix = "___";
    const char *classname = "Point";
  
    const char *methodname[] = {"Init", "PrintBoth", "PrintSelf", "equals"};
  
    for (int i = 0; i &lt; 4; i++)
      {
        string label = prefix + classname + "." + methodname[i];
        names.push_back(label.c_str());
      }
  
    for (int i = 0; i &lt; 4; i++)
      cout &lt;&lt; names[i] &lt;&lt; endl;
  
    return 0;
  }
  </code></pre>
  
  <p>However, the result is not what I've expected:</p>
  
  <pre><code>___Point
  ___Point.PrintSelf
  ___Point.PrintSelf
  ___Point.equals
  </code></pre>
  
  <p>Also, I noticed if I simply push back the methodname</p>
  
  <pre><code>names.push_back(methodname[i])
  </code></pre>
  
  <p>I get all the methodnames in order.</p>
  
  <p>What have I done wrong here?</p>