Reading by character and by line from stdin

Jonathan M Davis jmdavisProg at gmx.com
Thu Aug 25 11:26:55 PDT 2011


On Thursday, August 25, 2011 10:49 bellinom wrote:
> Hello,
> 
> I'm in the process of learning D, and I have some questions about reading
> from stdin. I've checked out the documentation but it's really not helping
> too much. I'd like to know how to read from stdin one character at a time,
> read with whitespace as a delimiter, and read line by line. Essentially
> just the equivalents of cin.get(), cin >>, and cin.getline(). At the
> momoent I'm using the D compiler on www.ideone.com, which I assume uses
> Phobos.
> 
> Thanks in advance for any help.

I would point out that www.ideone.com is horribly out of date. It uses dmd 
2.042, while the latest version is 2.054. So, some stuff will not work there 
in the same way that they work with the latest release.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list