+ 1
Values interpreted as variables
I am coding a calculator, and in its current code has some variables of type "Console.ReadLine ()", and when running the code the values of these variables are interpreted as other variables. why? for example: string a = Convert.ToString(Console.ReadLine()); if (a == wow) Console.WriteLine("WOW"); else Console.WriteLine("wow"); there is an exemple code: https://code.sololearn.com/cDffyb99aNE5/?ref=app
2 Answers
+ 3
if you want to compare variables with string use quoation marks so the compiler know that you're comparing variable with string, not variable with variable
a == "wow"
0
thanks, I really dont think in this.
I was tried to make a new variable and compare, but isn't works too