title: read binary data by C++
body: <p>I try to read binary data by C++ program below. But it can not display values. <a href="https://www.dropbox.com/s/lcwg04ajn0c1m6h/mall_area_fr_bounding_box_BW.bin?dl=0" rel="nofollow">The data</a> is saved as 8bit unsigned char. Let me know how to solve it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main(int argc,char *argv[])
  {
      if(argc!=2)
      {
          cout &lt;&lt; "argument error" &lt;&lt; endl;
          return 1;
      }
  
      ifstream file (argv[1], ios::in|ios::binary);
      //ifstream fin( outfile, ios::in | ios::binary );
  
      if (!file)
      {
          cout &lt;&lt; "Can not open file";
          return 1;
      }
  
      unsigned char d;
  
      while(!file.eof())
      {
          file.read( ( char * ) &amp;d, sizeof( unsigned char ) );
  
          cout &lt;&lt; d &lt;&lt; endl; 
      }
  
      file.close(); 
  
      return 0;
  }
  </code></pre>