Aaron

Aaron

  • NA
  • 3
  • 0

Comparing two Chars?

Dec 19 2007 6:34 PM

I am trying to compare two characters.  I can watch the charTemp array fill up and when it gets to the character I am comparing it to, it just bypasses it as if they are not equal.  The code is as follows.  Am I comparing them incorrectly?  Do I need to compare the decimal value or something?

EDIT: This ((char)tr.Read() == '&') which is right above it works fine. And I have initialized the char array as:

char[] charTemp = new char[50];


while (charTemp[i] != '%')
{
   charTemp[i] = (
char)tr.Read();
   
i++;
}

Thanks
Aaron


Answers (1)