title: Vector<char*> push_back overwrites all entries
body: <p>I want to use the push_back function to fill my vector with lines from a text file. But it overwrites all entries with the last line. Here is the source code:</p>
  
  <pre><code>  int main() {
      std::vector&lt;char*&gt; lines;
      FILE* file;
      file = fopen("textfile.txt", "r");
      const size_t max_line_length = 1000;
      char line[max_line_length + 1];
      while ( !feof(file)) {
        fgets(line, max_line_length, file);
        lines.push_back(line);
      }
      fclose(file);
   }
  </code></pre>
  
  <p>Hope somebody can help.</p>