2 param Problems

Fabian Claßen admin at fabs-world.de
Mon Dec 1 04:56:47 PST 2008


Derek Parnell Wrote:

> On Sun, 30 Nov 2008 10:58:50 -0800, Walter Bright wrote:
> 
> > Fabian Claßen wrote:
> >> 	double zahl = add(1, 5.6, 41, "Hello");
> >> 	writefln("%d", zahl);
> > [...]
> >> 
> >> When I try to run this codes there is printed following message in the cmd:
> >> 
> >> Error: std.format floating
> >> 
> >> Please help me. I have no idea.
> > 
> > %d is for integral arguments, not floating point ones. Try %s.
> 
> Also note that you would use '%f' or '%g' if you wanted to force runtime
> type checking on your arguments. The '%s' does not force typechecking as it
> converts whatever argument it is given to a string. You would also use "%f"
> if you needed finer formatting details, such as "%5.2f" etc ...
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> skype: derek.j.parnell

Hi
thanks for that information.
You are a big help.
;)
Greetings Fabian Claßen





More information about the Digitalmars-d mailing list