best replacement for - cout << "hello D" << endl; ?

Carlos Santander csantander619 at gmail.com
Wed Jul 11 18:47:50 PDT 2007


Bruce Adams escribió:
> 
> and type safe compared to:
> 
> stdout.writefln("%s%s%i", foo,bar,2);
> 

D has typesafe variadics, so you can just say:

dout.writefln("%s%s%s", foo,bar,2);

%s doesn't mean "pretend it's a string," but rather "write its string 
representation."

-- 
Carlos Santander Bernal


More information about the Digitalmars-d-learn mailing list