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

rikki cattermole rikki at cattermole.co.nz
Wed Sep 7 23:06:44 UTC 2022


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


More information about the Digitalmars-d-learn mailing list