title: How to easy convert LPBYTE to char[256] (used to read text from windows registry)
body: <p><strong>How I can convert LPBYTE to char [256]?</strong></p>
  
  <p>When I read from Windows registry value:</p>
  
  <p>blah REG_SZ "blah some text"</p>
  
  <pre><code>char value[256];
  DWORD keytype = REG_SZ;
  DWORD dwCount = sizeof(value);
  RegQueryValueEx((HKEY)key, "blah", 0, &amp;keytype, (LPBYTE)&amp;value, &amp;count);
   cout &lt;&lt; "Read text from registry: " &lt;&lt; value &lt;&lt; endl;
  </code></pre>
  
  <p>after cout this it shows (screenshot):</p>
  
  <p><a href="http://i33.tinypic.com/dnja4i.jpg" rel="nofollow noreferrer">http://i33.tinypic.com/dnja4i.jpg</a></p>
  
  <p>(normal text + some signs)</p>
  
  <p>I must compare value from registry:</p>
  
  <pre><code> if("blah some text" == value)
    cout &lt;&lt; "Kk, good read from registry\n";
  </code></pre>
  
  <p>How I can convert this LPBYTE value to char[256] ?</p>