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
Song Lee
NA
47
38.3k
Another do, if method that I'm trying out.
Oct 19 2014 8:03 PM
Hello, I am trying out different ways to receive int number from user. If the input is not an int number, it gives out an error message.
But I seem to be getting error messages on the highlighted parts.
"Since ___________ Returns a void, a return keyword must not be followed by an object expression "
public static void
FirstInput()
{
do
{
fromF = 0;
if
(
int
.TryParse(
Console
.ReadLine(),
out
fromF))
{
return
fromF;
}
Console
.WriteLine(
"Error"
);
{
return
FirstInput();
}
}
}
Thanks for the help!
Reply
Answers (
5
)
Errors in c#
Close, Open, Update, UpdateBatch, AbsolutePosition, and more