Wednesday, 17 July 2013

Difference between Read() and ReadLine() in C#.net

ReadLine():It is used to read the values into variables from the keyboard and it is similar to the library function "scanf" in "C' language
var=Console.ReadLine();
1.ReadLine method will return any value enter to the keyboard as a string
2.vb.net will automatically perform type casting when you read the values for variables other then string
Here i will provide MSDN ReadLine link to get the brief explanation on it.

Read():
1.This method is similar to the library function getch() in "c" language .
2 It is used to read the single character and will not be displayed on the screen
3.MSDN Read() Method

No comments:

Post a Comment