title: Why can't I provide a string argument to printw in ncurses?
body: <p>For an application that I'm writing, I have a string type variable that I want to display within an ncurses window: </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;ncurses.h&gt;
  #include &lt;string&gt;
  
  int main(){
    std::string mystring = "A sample string\n";
  
    // Entering the ncurses window
    initscr();
    printw(mystring);
    getch();
    endwin();
  
  }
  </code></pre>
  
  <p>which throws the following error at compilation: </p>
  
  <pre><code>test_app.cpp: In function ‘int main()’:
  test_app.cpp:12:18: error: cannot convert ‘std::__cxx11::string {aka std::__cxx11::basic_string&lt;char&gt;}’ to ‘const char*’ for argument ‘1’ to ‘int printw(const char*, ...)’
     printw(mystring);
  </code></pre>
  
  <p>Where am I going wrong? How can I rectify this?</p>