C# Console Read
Description
Console Read
reads the next character from the standard
input stream.
Syntax
Console.Read
has the following syntax.
[HostProtectionAttribute(SecurityAction.LinkDemand, UI = true)]
public static int Read()
Returns
Console.Read
method returns The next character from the input stream, or negative one (-1) if there are
currently no more characters to be read.
Example
The following example demonstrates the Read method.
//from w w w .ja v a2 s. c o m
using System;
class Sample
{
public static void Main()
{
int x = Console.Read();
}
}