title: How to open a file in boost
body: <p>I am relatively new to using the boost library for c++ and I am wondering how to open a file using this. My aim is to read from a json file however I do not know how to open the file.</p>
  
  <p>In c++, you can do this</p>
  
  <pre><code>int main () {
    ofstream myfile;
    myfile.open ("example.txt");
    myfile &lt;&lt; "Writing this to a file.\n";
    myfile.close();
    return 0;
  }
  </code></pre>
  
  <p>but how can I do this using boost?</p>