[solved] simple char compare always matches

I'm guessing I'm going to feel like an idiot when I find out the answer to this but here goes...

I was writing a large program and am fairly familiar with both C++ & Arduino but one piece didn't want to work. I finally narrowed it down to a char compare line. As it made no sense to me that it wasn't working I created a simple program (see the code below) to try and see if it was something else in the large program causing the problem. However, the problem occurs even in the stripped down version. If I run it as is then the output is [BA][CA] repeated over and over which shouldn't be since status is not A so the "if" should not be true so the output s/b [BA] repeated over and over. If I change the 'A' to 'X' it still gives the same output which in that case it should.

Please help this one to understand the error of his ways. Thanks!

char status        ;
void setup()         
 {        
 Serial.begin(115200)        ;
 Serial.println("Processing...")        ;
 }        
void loop()         
 {        
  status='A';
   Serial.print('{');
   Serial.print('B');
   Serial.print(status);
   Serial.print('}');
   if(status == 'X')    ;
    {     
   Serial.print('{');
   Serial.print('C');
   Serial.print(status);
   Serial.print('}');
    }     
 delay(3000)        ;
 }

Get rid of the ';'?

if(status == 'X');

And after that, fix the layout / indentation. Press Ctrl + T. Makes it wayyyyy easier to spot errors like that.

Thanks

Like I said... I feel like an idiot

A stupid typo that should've been obvious to me.

A stupid typo that should've been obvious to me.

You should adopt the habit that I use. Type if followed by the open paren, the close paren, a carriage return, an open brace, a carriage return, and a close brace. Then, go back and fill in the conditional expression and the body of the statement. You'll never hang a useless semicolon at the end of the if statement that way.