Re: Struct List Human

2017-09-24 Thread dark777 via Digitalmars-d-learn
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");

Re: Struct List Human

2017-09-24 Thread dark777 via Digitalmars-d-learn
On Sunday, 24 September 2017 at 17:05:11 UTC, Neia Neutuladh wrote: On Sunday, 24 September 2017 at 16:13:30 UTC, dark777 wrote: when you execute and call Name: I type my name: Name: dark777 + [enter] and he does not jump to the next line to get the age This is what I want to know how to

Re: Struct List Human

2017-09-24 Thread Adam D. Ruppe via Digitalmars-d-learn
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

Re: Struct List Human

2017-09-24 Thread Neia Neutuladh via Digitalmars-d-learn
On Sunday, 24 September 2017 at 16:13:30 UTC, dark777 wrote: when you execute and call Name: I type my name: Name: dark777 + [enter] and he does not jump to the next line to get the age This is what I want to know how to solve. Add a `writeln();` after reading input, maybe?

Re: Struct List Human

2017-09-24 Thread dark777 via Digitalmars-d-learn
On Sunday, 24 September 2017 at 15:51:01 UTC, dark777 wrote: On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote: On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote: I have the following code: https://pastebin.com/PWuaXJNp but typing my name does not go to the next line as

Re: Struct List Human

2017-09-24 Thread dark777 via Digitalmars-d-learn
On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote: On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote: I have the following code: https://pastebin.com/PWuaXJNp but typing my name does not go to the next line as soon as I press enter how to solve this? use writeln instead

Re: Struct List Human

2017-09-24 Thread Suliman via Digitalmars-d-learn
On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote: I have the following code: https://pastebin.com/PWuaXJNp but typing my name does not go to the next line as soon as I press enter how to solve this? use writeln instead write

Struct List Human

2017-09-24 Thread dark777 via Digitalmars-d-learn
I have the following code: https://pastebin.com/PWuaXJNp but typing my name does not go to the next line as soon as I press enter how to solve this?