How to convert?
<p>Another try. How to convert this code:</p>

<pre><code>void WrightPL(Field * field, char * _file){
    fstream file;
    file.open(_file, fstream::app);
    for (int i = 0; i&lt;field-&gt;blocks.size();i++){
        file&lt;&lt;" "&lt;&lt;field-&gt;blocks[i].name&lt;&lt;" "&lt;&lt;field-&gt;blocks[i].GetX()&lt;&lt;" "&lt;&lt;field-&gt;blocks[i].GetY()&lt;&lt;" : N"&lt;&lt;endl;
    }
    file.close();
}
</code></pre>

<p>Following this advice:</p>

<blockquote>
  <p>To read the data from the file, just use some <code>std::string</code> variables for any text, and ints for the numbers, as in <code>while (instream &gt;&gt; name &gt;&gt; firstnum &gt;&gt; secondnum &gt;&gt; colon &gt;&gt; n) outstream &lt;&lt; name &lt;&lt; (rand() % max) &lt;&lt; (rand() % max) &lt;&lt; ": N\n";"</code>
  ?</p>
</blockquote>

<p>I can't write full code following this advice.</p>
