On Sunday, 24 September 2017 at 18:00:32 UTC, Adam D. Ruppe wrote:
I think readf("%s") reads everything available. readf(" %s\n") might help but personally, I say avoid readf.

Just use readln and to!int instead


auto line = readln();
if(line.length == 0)
   writeln("please enter a number");

age = to!int(line);


to is from import std.conv

I added \n and it worked.

I created a float variable and wanted to know how to read or print the same?

reading?

write ("Weight:");
   readf (" %ld\n", &peso);

and

writefln ("Weight:% ld", human.peso);

but he returned me errors

Reply via email to