Trouble reading serial input as a type (eg char)

I have a program that sends and receives serial data. The board picks this up and does stuff depending on that the input was (in this case a char). Pretty straight forward stuff. However I cant seem to get the return value to be treated as a char. Any help would be appreciated.

I have cobbled together this form stuff on the net.

...snip        
if (Serial.available() > 0){
      returned[0] =  Serial.read() - 48;       
      if (returned[0] == 'p') { //p for processing
        isProcessing = true;
        break;
    } // else it remains false and we abort
}
...snip

First of all I am not exactly sure why i need to take of 48.
Secondly, how do I get returned[0] == 'p' to actually work as a comparison?

Why are you subtracting 48 from the input?

-j

Like I said, I am not totally sure.

I think I was misunderstanding what was going on here. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1223411991/4

Subtracting 48 from a byte received over a serial link is a commonly used technique for converting an ASCII-encoded digit to its binary equivalent.

'0' = 0x30 = 48: subtract 48 and you get 0
'1' = 0x31 = 49: subtract 48 and you get 1
...

If, however, the byte is NOT a ASCII-encoded digit, this doesn't make any sense at all.

If you expect someone to send the letter 'p', then just check for it directly:

if (Serial.available() > 0){
      returned[0] =  Serial.read();
      if (returned[0] == 'p') { //p for processing
        isProcessing = true;
        break;
    } // else it remains false and we abort
}

Mikal

That made everything work perfect. Thank you very much for your help.