title: Converting std string to const char*
body: <p>I am getting an error when I run this piece of code</p>
  
  <pre><code>  string line;
    getline (myfile,line);
    char file_input[15];
    strncpy(file_input, line, 6);
    cout &lt;&lt; line &lt;&lt; endl;
  </code></pre>
  
  <p>Error - cannot convert ‘std::string’ to ‘const char*’ for argument ‘2’ to ‘char* strncpy(char*, const char*, size_t)’
  How to get rid of this?</p>