I have a problem with Console.WriteLine()
When I try to print mathematical signs (+ , *
) and other symbols (@, #, \, ~ , ;, ", '
),
I receive Unhadled.Exception: System.NullReferenceException.
If I insert a letter from the alphabet or a number everything is alright.
string expression = Console.ReadLine();
foreach (char symbol in expression)
{
Console.WriteLine(symbol);
}
Screenshot of NullReferenceException
https://i.stack.imgur.com/buDRZ.png
Proof Image
https://i.stack.imgur.com/IAL7y.jpg