We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e95fabb + 3ca07de commit 1951decCopy full SHA for 1951dec
std/stdio.d
@@ -3415,6 +3415,22 @@ void write(T...)(T args) if (!is(T[0] : File))
3415
*
3416
* Throws:
3417
* In case of an I/O error, throws an $(LREF StdioException).
3418
+ * Example:
3419
+ * Reads $(D stdin) and writes it to $(D stdout) with a argument
3420
+ * counter.
3421
+---
3422
+import std.stdio;
3423
+
3424
+void main()
3425
+{
3426
+ string line;
3427
3428
+ for (size_t count = 0; (line = readln) !is null; count++)
3429
+ {
3430
+ writeln("Input ", count, ": ", line);
3431
+ }
3432
+}
3433
3434
*/
3435
void writeln(T...)(T args)
3436
{
0 commit comments