TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
amit_gupta14
NA
119
0
How to get actual integer input from Console?
Dec 7 2004 11:53 PM
How to get actual integer input from Console? There are 2 scenarios. 1. If we use Console.Readline(), it will return string. We can use Int32.parse(string) to convert the input to integer. Is Console.ReadLine() is good if input is only one character say 'Y' 2. If we use Console.Read(), it will accept character and return integer. It is good for those input where we are sure that input is like 'Y' or 'N'. Suppose input is 'A'. Then Console.Read() will return 65. Again we have to convert it to char to get 'A'.IS not this extra step? My question is which is better general/common appraoch for any type of input
Reply
Answers (
1
)
code error, can any one tell me where is the error
What's the purpose of throw in Catch Block?