Logo

Programming-Idioms

  • VB
  • C#
  • Haskell
  • Pascal

Idiom #278 Read one line from the standard input

Read one line into the string line.

Explain what happens if EOF is reached.

readln(line);

processing reading the inputs stops when EOF is reached.
using System;
var line = Console.ReadLine();

Returns `null` if EOF is triggered and no characters are supplied.
with Ada.Text_IO;
Line : constant String := Ada.Text_IO.Get_Line;

End_Error is raised if EOF is reached.

New implementation...