Problems with MemoryStream

Tobias Pankrath tobias at
Sat Jan 22 14:32:18 PST 2011


I just got my hands on a copy of TDPL and I like the book and D is very
promising. But I run into problems with the easiest of program. I just
want to write to and from a stream, just the way it is possible with
C++ stringstreams. But this program produces an empty line as 

/** begin program
import std.stdio;

void main() {
  auto stream = new MemoryStream( );
  string s = "this is a line";
  char[] get = stream.readLine();
// end of program

Why? Whats the right way to do it?

Greetings, Tobias

More information about the Digitalmars-d-learn mailing list