C++: Saving the class object in archived format which is having char * attributes and read it back from file
<p>Assume I have a class</p>

<pre><code>class A
{
 char *attr1,*attr2;
public:
 . . .
};
</code></pre>

<p>How to save the object of this class to file in a binary format and read it back?</p>

<p>Thanks.</p>
