Writing and reading vector into binary files
<p>I have a vector:</p>

<pre><code>class Element
{
public:

    string pathName;
    ui64 offsitePtr;
    ui64 subPage;

public:

    Element(void);

    ~Element(void);
};

vector&lt;Element&gt; elem;
</code></pre>

<p>The size of <code>elem</code> will be controlled less than 4096 bytes. At the end of the program, I should <code>fwrite</code> <code>elem</code> into a binary file. The solution I'm using currently is to make a char buffer and write the element in <code>elem</code> in it. I don't think it is a good idea. Is there any other good ideas?</p>
