title: Reading binary file C++
body: <p>Please, help me. I can't read binary file. The file's length is 198944, but my code reads 374.  I tried to use fread, ifstream, WinAPI ReadFile.
  This is the function that reads file:</p>
  
  <pre><code>std::string ReadThisFile(std::string aPath) {
     FILE *inputstream = fopen(aPath.c_str(),"rb");
     long size;
     size_t result; 
     fseek(inputstream,0,SEEK_END); 
     size = ftell(inputstream); 
     rewind(inputstream); 
     char *buff = new char [size];
     result = fread (buff,1,size,inputstream); 
     std::string ret=buff; 
     fclose(inputstream); 
     delete[]buff; 
     return ret; 
  }
  </code></pre>
  
  <p><a href="http://dl.dropbox.com/u/41777790/file.dat" rel="nofollow">File sample</a></p>
  
  <p>Any help is needed, thank you!</p>