title: Binary writing of INT16 on c++
body: <p>I have found out this way:</p>
  
  <pre><code>ofstream out("test", ios::out | ios::binary);
  UINT16 myint16=16;
  out.write((char*)&amp;myint16, sizeof(myint16));
  </code></pre>
  
  <p>But are there ways to write INT16 binary without declaring a variable?</p>