title: How to convert a boost::filesystem::directory_iterator to a const char *
body: <p>I want to iterate over all the files in a directory and print their contents.
  Boost handles the iteration part very nicely but I have no idea how to conver that into a <code>const char *</code>.</p>
  
  <pre><code>boost::filesystem::directory_iterator path_it(path);
      boost::filesystem::directory_iterator end_it;
      while(path_it != end_it){
        std::cout &lt;&lt; *path_it &lt;&lt; std::endl;
  
        // Convert this to a c_string
        std::ifstream infile(*path_it);
      }
  </code></pre>
  
  <p>I tried to read this <a href="http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/reference.html#Class-directory_iterator" rel="noreferrer">documentation</a> but couldn't find anything like <code>string</code> or <code>c_str()</code>. I'm new to both <code>C++</code> and <code>boost</code> and was hoping to find some <code>javadoc</code> like documentation which would basically tell me what the members were and what functions were availabe instead of dumping the source code.</p>
  
  <p>Sorry for the rant but could someone tell me how to convert <code>*path_it</code> into a <code>c string</code>.</p>