podarray&lt;unsigned char&gt; data(N);<br>
<br>
data[N-1] could be anything. We could initialise it to char(20)  and this<br>
problem can be fixed. As I understood, the problem is that it could come up<br>
in other cases where the file is not opened as binary. MLPack appears to be<br>
doing the right thing when it comes to reading a binary file. When a file<br>
is opened as a text file Armadillo is treating it like a binary file. This<br>
is where the problem arises.<br>
<br>
Conrad S:<br>
<br>
<br>
<br>
<br>
<br>
<br>
*I looked at the documentation for C++, and I don&#39;t think it&#39;s possible to<br>
detect how a stream was opened. I&#39;ll update Armadillo&#39;s documentation to<br>
state that the streams must be opened in binary. *<br>
<br>
If you want me to run any test on Windows do let me know.<br>
Joe<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/468#issuecomment-155717037">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFH23sFHztFRDLDfLr4vwhBSiwghmks5pEwSsgaJpZM4Gd7SI.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/468#issuecomment-155717037"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>