Type conversions in D

Seb via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 21 14:09:11 PST 2017


On Tuesday, 21 February 2017 at 21:39:37 UTC, Jean Cesar wrote:
> I once saw an article that talked about type conversions using 
> the D language.
>
> Type convert integer to exadecimal, binary, but I'm thinking of 
> writing an article in my blog but I do not find the site I saw 
> on to know more information of the same type as I did below.
>
> void main()
> {
>   int a=15;
>
>  writefln("O numero %s em binario é %b", a, a);
> }

Note that what you are looking for is a library feature:

https://dlang.org/phobos/std_conv.html

In fact every type can implement its own specific format handling:

https://dlang.org/phobos/std_format.html


More information about the Digitalmars-d-learn mailing list