title: Fstream read function does not write data into indicated address
body: <p>My problem is concerning the following code:</p>
  
  <pre><code>void znajdzNastepnyElement(fstream&amp; baza, unsigned int&amp; licz_zaglebienie, unsigned long long int&amp; kursor, unsigned long long int&amp; poczatek_elementu, const unsigned int&amp; dl_baza) {
      char znak = '\0';
      if (kursor &lt;= dl_baza) {
          while (znak != '{' &amp;&amp; kursor &lt;= dl_baza) {
              baza.seekg((kursor) * sizeof(char), ios::beg);
              baza.read(&amp;znak, sizeof(char));
              cout &lt;&lt; endl &lt;&lt; "Znak =" &lt;&lt; znak &lt;&lt; "Kursor = " &lt;&lt; kursor &lt;&lt; endl;
              if (znak == '{') {
                  licz_zaglebienie++;
                  poczatek_elementu = kursor;
              }
              if (znak == '}')
                  licz_zaglebienie--;
          kursor++;
          }
          cout &lt;&lt; "Szukam elementu" &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>It is basically meant to find the following "{" character in the json file (which is full of these curly braces). Debugging that function showed, that only the first time, when program performs it results in saving "{" into &amp;znak, since then nothing but "\0" (that actually depends on what I save into 'znak' in line <code>char znak = '\0';</code>) replaces that value. What's even more confusing is that it only happens when the first character in json file is "{", every next matching character does not have such influence on program. To be clear, "{" occurence does not result in "fstream close" in any form outside of the function.</p>