char[] -> int or float...

Aarti_pl aarti at interia.pl
Tue Mar 27 06:27:25 PDT 2007


Gregor Kopp napisał(a):
> Gregor Kopp wrote:
>>> Daniel Keep wrote:
>>> http://www.digitalmars.com/d/phobos/std_conv.html
>>
>>
>> Thank you very much!
> 
> Okay, i figured it out how to do the conversion from char[] into a 
> float. I searched now for about 2 hours how to make this in the other 
> direction: float -> char[]
> Or any other buildin type (int, flaot, double, etc.), but I couldn't 
> find any useful information about this in the documention.
> 
> Is there any good documention outside there how to convert between 
> different types including char[]? Or generally a tutorial or 
> documentation about handling char[] and conversion?
> 
> Regards, Gregor

Please see to std.string module:
char[] toString(bool b);
char[] toString(char c);
char[] toString(ubyte ub);
char[] toString(ushort us);
char[] toString(uint u);
char[] toString(ulong u);
char[] toString(byte b);
char[] toString(short s);
char[] toString(int i);
char[] toString(long i);
char[] toString(float f);
char[] toString(double d);
char[] toString(real r);
char[] toString(ifloat f);
char[] toString(idouble d);
char[] toString(ireal r);
char[] toString(cfloat f);
char[] toString(cdouble d);
char[] toString(creal r);
	 Convert to char[].

Documentation for Phobos is far from perfect, but you can find most 
necessary things anyway.

Regards
Marcin Kuszczak
(aarti_pl)


More information about the Digitalmars-d-learn mailing list