Console I/O : Console Output « Development « C# / CSharp Tutorial






Console I/O is accomplished through the standard streams

  1. Console.In,
  2. Console.Out, and
  3. Console.Error.
  1. Console.In is an instance of TextReader.
  2. Console.In defines two input methods: Read() and ReadLine().
  3. Console.Out and Console.Error are objects of type TextWriter.
  4. Console.Out and Console.Error are objects of type TextWriter.
  1. You can use the FileStream class to create a byte-oriented stream attached to a file.
  2. FileStream is derived from Stream.
  3. FileStream contains all of Stream's functionality.








14.3.Console Output
14.3.1.Console I/O
14.3.2.WriteLine
14.3.3.Write without new line
14.3.4.Substituting Values
14.3.5.Substituting Values twice
14.3.6.Write to Console.Out and Console.Error
14.3.7.Output an int to console
14.3.8.Concatenate string in Console.WriteLine
14.3.9.Format the same argument three different ways
14.3.10.Display arguments in non-sequential order
14.3.11.Variable index
14.3.12.Variable index: reference a variable more than once
14.3.13.Escape Characters: \\
14.3.14.Adds a total of 4 blank lines (then beep again!)
14.3.15.Displaying a Triangle Using a Verbatim String Literal
14.3.16.Use OpenStandardOutput method.