digitalmars.D.learn - Struct List Human
- dark777 (5/5) Sep 24 2017 I have the following code:
- Suliman (2/7) Sep 24 2017 use writeln instead write
- dark777 (8/15) Sep 24 2017 nothing to see hand
- dark777 (8/24) Sep 24 2017 nothing to see hand
- Neia Neutuladh (2/8) Sep 24 2017 Add a `writeln();` after reading input, maybe?
- dark777 (4/14) Sep 24 2017 I changed the write by writeln and it still did not work, I added
- Adam D. Ruppe (8/8) Sep 24 2017 I think readf("%s") reads everything available. readf(" %s\n")
- dark777 (10/18) Sep 24 2017 I added \n and it worked.
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?
Sep 24 2017
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
Sep 24 2017
On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote:On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote:nothing to see hand 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.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
Sep 24 2017
On Sunday, 24 September 2017 at 15:51:01 UTC, dark777 wrote:On Sunday, 24 September 2017 at 15:22:30 UTC, Suliman wrote:nothing to see hand 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.On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote:nothing to see hand 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.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
Sep 24 2017
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?
Sep 24 2017
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:I changed the write by writeln and it still did not work, I added it after receiving the first entry and it did not work ...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?
Sep 24 2017
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
Sep 24 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.convI 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
Sep 24 2017