Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Another do, if method that I'm trying out.
Song Lee
Oct 19 2014 8:03 PM
668
Reply
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!
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Errors in c#
Close, Open, Update, UpdateBatch, AbsolutePosition, and more