* Read line from stdin and write it to buf[], including terminating character.
*
* This can be faster than line = readln() because you can reuse
* the buffer for each call. Note that reusing the buffer means that you
* must copy the previous contents if you wish to retain them.
*
* Returns:
* size_t 0 for end of file, otherwise number of characters read
* Params:
* buf = Buffer used to store the resulting line data. buf is resized as necessary.
* terminator = Line terminator (by default, '\n'). Use std.ascii.newline
* for portability (unless the file was opened in text mode).
* Throws:
* StdioException on I/O error, or UnicodeException on Unicode conversion error.
* Example:
* Reads stdin and writes it to stdout.
importstd.stdio;
voidmain()
{
char[] buf;
while (readln(buf))
write(buf);
}
* Read line from stdin and write it to buf[], including terminating character. * * This can be faster than line = readln() because you can reuse * the buffer for each call. Note that reusing the buffer means that you * must copy the previous contents if you wish to retain them. * * Returns: * size_t 0 for end of file, otherwise number of characters read * Params: * buf = Buffer used to store the resulting line data. buf is resized as necessary. * terminator = Line terminator (by default, '\n'). Use std.ascii.newline * for portability (unless the file was opened in text mode). * Throws: * StdioException on I/O error, or UnicodeException on Unicode conversion error. * Example: * Reads stdin and writes it to stdout.