Re: Error "Unexpected '\n' when converting from type LockingTextReader to type int"

2022-09-07 Thread Ali Çehreli via Digitalmars-d-learn
On 9/7/22 16:24, Synopsis wrote: > a- What is the difference with this syntax with the exclamation mark? > ```readf!"%s\n"(f1.num);``` That's the templated version, which is safer because it checks at compile time (important distinction) that the arguments and the format specifiers do match.

Re: Error "Unexpected '\n' when converting from type LockingTextReader to type int"

2022-09-07 Thread rikki cattermole via Digitalmars-d-learn
On 08/09/2022 11:24 AM, Synopsis wrote: On Wednesday, 7 September 2022 at 23:06:44 UTC, rikki cattermole wrote: Text in buffer: "123\n" Read: "123" Text in buffer: "\n" Read: exception, expecting number for "\n" Changing your readf format specifier to include the new line should work.

Re: Error "Unexpected '\n' when converting from type LockingTextReader to type int"

2022-09-07 Thread Synopsis via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 23:06:44 UTC, rikki cattermole wrote: Text in buffer: "123\n" Read: "123" Text in buffer: "\n" Read: exception, expecting number for "\n" Changing your readf format specifier to include the new line should work.

Re: Error "Unexpected '\n' when converting from type LockingTextReader to type int"

2022-09-07 Thread rikki cattermole via Digitalmars-d-learn
Text in buffer: "123\n" Read: "123" Text in buffer: "\n" Read: exception, expecting number for "\n" Changing your readf format specifier to include the new line should work. https://dlang.org/phobos/std_stdio.html#.File.readf