title: Write byte to ofstream in C++
body: <p>I have char array, and i want to write it to txt file, but in bytes.</p>
  
  <pre><code>ofstream sw("C:\\Test.txt");
  for(int i = 0; i &lt; 256; i++)
  {
    sw &lt;&lt; (byte)myArray[i]; 
  }
  </code></pre>
  
  <p>This will write chars into the file, but i want to write bytes. If there is char 'a' i want to write '97'. Thank you.</p>