I want to compare elements in a object type array with a user input. To do that I wrote the following code. There is no error in the code but I found out that object comparison does not work as I expected. How can I edit my code to compare user inputs with predefined array?
class Program
{
static void Main(string[] args)
{
object[] Mathfunction = new object[] { '+','-','*','/'};
Console.WriteLine("Enter");
object input = Console.ReadLine();
for(int i=0;i<4;i++)
{
if (Mathfunction[i] == input)
{
Console.WriteLine("done");
Console.ReadLine();
}
}
}