I can ask questions about dmd on windows here in this forum?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 30 22:27:15 PDT 2014


On 08/30/2014 08:37 PM, Cassio Butrico wrote:

 > My question is about wstring and dstring,
 > which and the best way to input data, converting and which should I use

Unless there is a specific reason not to, use 'string'. When you really 
need random access to characters, then use 'dstring'.

To input data, readf() is for formatted input:

     int i;
     readf(" %s", &i);

When reading a whole line as a string, consider

import std.stdio;
import std.string;

// ...

     string line = chomp(readln());

Ali



More information about the Digitalmars-d-learn mailing list