digitalmars.D.learn - Equivalent to C++ iostream cout
- Tommy (10/10) Aug 02 2005 Hi, is there an equivalent to C++ iostream's cout so that I can display
- Ben Hinkle (7/17) Aug 02 2005 Are you looking for
- Tommy (3/8) Aug 02 2005 Ah! Didn't understand the docs in this case. Thanks!
Hi, is there an equivalent to C++ iostream's cout so that I can display several data types in a simple way such as int d = 10; double x = 0.4711; cout << "d is " << d << " and x is " << x << "."; I believe that D's function set in Phobos requires me to use different output functions for different data types which can be quite clumsy at times. Thanks, Tommy
Aug 02 2005
"Tommy" <Tommy_member pathlink.com> wrote in message news:dcojve$2h34$1 digitaldaemon.com...Hi, is there an equivalent to C++ iostream's cout so that I can display several data types in a simple way such as int d = 10; double x = 0.4711; cout << "d is " << d << " and x is " << x << "."; I believe that D's function set in Phobos requires me to use different output functions for different data types which can be quite clumsy at times. Thanks, TommyAre you looking for import std.cstream; dout.writef("d is ",d," and x is ",x,"."); Format control can be supplied with something like dout.writef("d is %5d and x is %.10e.",d,x);
Aug 02 2005
In article <dcon3r$2jii$1 digitaldaemon.com>, Ben Hinkle says...Are you looking for import std.cstream; dout.writef("d is ",d," and x is ",x,"."); Format control can be supplied with something like dout.writef("d is %5d and x is %.10e.",d,x);Ah! Didn't understand the docs in this case. Thanks! Tommy
Aug 02 2005