코드에서 catch-try를 사용한 후에이 오류가 발생합니다. try-catch를 내 코드에서 사용하지 않으면 편집기에서이 오류를 표시하지 않지만 try-catch 코드로 프로그램을 닫으면이 오류가 발생합니다. 내 코드는 다음과 같습니다.할당되지 않은 지역 변수 'month'사용
try
{
month = Int32.Parse(Console.ReadLine());
}
catch (FormatException ee)
{
Console.WriteLine(ee.Message);
}
if (month > 12 || mnth < 0)
{
Console.Write("----Incorrect Month...plz Re-");
lp_val = 1;
}
오류가 나타내는대로 month를 mnth로 바꾸십시오. – dotTutorials
'month'과'mnth' 변수가 다른가요? 아니면 타이핑을 놓쳤습니다. –