So I run this piece of code:
public class whatever
{
public bool checkArray(object[] a, object x)
{
int goThrowArray = 0;
bool res = false;
while (goThrowArray != a.Length)
{
object tempVar = a[goThrowArray];
if (tempVar == x)
{
res = true;
}
goThrowArray++;
}
return res;
}
}
And even when x equals a[goThrowArray] It still returns false... Example:
whatever checking = new whatever();
object[] s = { 1,2,3,54,62};
Console.Write(checking.checkArray(s,3));
And then we run rest of the code in the debugger
I tried changing data types, debugging etc. But no matter what it still returns false.