I am working with Microsoft Visual C# and keep getting the error "Use of unassigned local variable 'letter'" and everything I've tried has not fixed it, not to mention looking on the web. What is the issue?
private void Btn_Submit_Click(object sender, EventArgs e)
{
char letter;
int number;
Txt_Letter.Text = letter.ToString(); // the "letter" before ToString is showing up the error
number = Convert.ToInt32(Txt_Number.Text);
if (((letter >= 'a' && letter <= 'z') ||
(letter >= 'A' && letter <= 'Z')) &&
(number > 0 && number < 27))
{
Alphanum(letter, number);
}
else
{
MessageBox.Show("Please pick a letter and number between 1 and 26.");
Txt_Letter.Text = "";
Txt_Number.Text = "";
Txt_Letter.Focus();
}
}