I'm new to this field and I'm very confused: what is the real difference between Console.Read()
and Console.ReadLine()
?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Console.Read()
basically reads a character so if you are on a console and you press a key then the console will close, meanwhileConsole.Readline()
will read the whole string.=> reads only one character from the standard input
=> reads all characters in the line from the standard input
Console.Read()
reads a single key, whereConsole.Readline()
waits for the Enter key.This was clearly described with examples in the MSDN documentation (links are included above).
MSDN is actually pretty clear on this one.