title: Dlang string to char * conversion
body: <p>I've got this code reading from a bin file.
  the data is held in an array of structs and null terminated
  My goal is to read data, written in c-code with 
  <code>write (filehandle, (char *)arrayOfCELLs, sizeof(arrayOfCELLs);</code> 
  to a file, into the same structure arrayOfCELLs using D.</p>
  
  <p>My problem is that in c I read the file into a struct arr[] via a cast to (char *)</p>
  
  <pre><code>read(filehandle, (char *)arrayOfStructs, sizeof(arrayOfStructs)
  </code></pre>
  
  <p>In D I found out through <a href="https://stackoverflow.com/users/1435461/rcorre">rcorre</a> that led me to <a href="https://dlang.org/phobos/std_stdio.html#.File.rawRead" rel="nofollow noreferrer">rawRead</a></p>
  
  <pre><code>auto buffer = FileHandle.rawRead(arrayOfStructs)
  </code></pre>
  
  <p>where the buffer gets the data to the sizeof arrayOfStructs.</p>
  
  <p>However, here comes my problem, the buffer seems to get the rawdata including nulltermination but all positioned in [0] of the receiving Array, also, I don't understand/know what the datatype it is(CELL[] or string[] or .....</p>
  
  <pre><code>struct CELL{ char [20] name, int sect, int type ...};
  struct CELL [50] arrayOfCELLs;
  auto buffer = ..rawRead(arrayOfCELLs)
  </code></pre>
  
  <p>received data in the buffer is (part of it) this</p>
  
  <pre><code>[CELL("TEST\0feed\0\0\0\0\0\0\0\0\0\0\0", 1, 1,
  </code></pre>
  
  <p>The first is the name, "TEST" followed by null-termination, then sect = 1, ptyp = 1 . Now the second CELL holds this</p>
  
  <pre><code>CELL("\x01\0\0\0\x02\0\0\0N\0\0\0\x04\0\0\0\x02\0\0\0", 65656, 655375,
  </code></pre>
  
  <p>And that is all wrong, Should be "test" and 2,1, 
  If I do a cat in the terminal I get </p>
  
  <pre><code>anders$ cat cellspec
  TESTfeedOx
  atestTailingNx
  aOF2 cycl primO?
  </code></pre>
  
  <p>Question, any ideas why this is and what can I do to get it right?</p>