title: problem in reading binary file (mix of ascii and binary)
body: <p>My code for reading binary file is:</p>
  
  <pre><code>dataFile.open(fileName.c_str());
  ifstream binData("Trafficlog_Data.txt", ios::in | ios::binary);  //binary data file 
  if(!binData) { 
    cout &lt;&lt; "Cannot open file.\n"; 
    return -1; 
  } 
  char *memblock;int nBytes =12;
  memblock = new char [nBytes+1];
  binData.read(memblock,nBytes);
  memblock[nBytes+1]='\0';
  std::string message;message.assign(memblock,nBytes);
  printf("%s\n",message.c_str());
  </code></pre>
  
  <p>Now i have given a file as input which contain binary and ascii data<br>
  RFB 003.003<br>
  RFB 003.003<br>
  --some binary data--</p>
  
  <p>When I am reading first 12 bytes of file which is "RFB 003.003\n" but it prints "RFB 003.003=". Can anyone tell where i m getting it wrong please.
  promblem is not with '\0'. problem is it is not reading "RFB 003.003\n" . IS it because this file is mix of binary and ascii data</p>