Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.29 KB | None | 0 0
  1.   auto buf = array(new ubyte[j.toString().length+4]);
  2.   size_t index = 0;
  3.   buf.write!uint(cast(uint)buf.length, &index);
  4.  
  5.   buf.put(j.toString()); // Leaves buf as [0,0,0,0]
  6.   writeln(buf);
  7.  
  8.   foreach (c; j.toString()) { // Working as intended
  9.     buf.write!char(c, &index);
  10.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement