Struct List Human

dark777 jeanzonta777 at yahoo.com.br
Sun Sep 24 19:22:16 UTC 2017


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


More information about the Digitalmars-d-learn mailing list