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!