string copare

Hello,
I want to read a SMS i send to my gsm shield and then depend on what i send i want arduino to do something.
here is the code:

#include <SoftwareSerial.h>
SoftwareSerial SIM900(2, 3);

char incoming_char=0;

void setup()
{
  Serial.begin(19200); // for serial monitor
  SIM900.begin(19200); // for GSM shield
  SIM900power();  // turn on shield
  delay(20000);  // give time to log on to network.

  SIM900.print("AT+CMGF=1\r");  // set SMS mode to text
  delay(100);
  SIM900.print("AT+CNMI=2,2,0,0,0\r"); 
  // blurt out contents of new SMS upon receipt to the GSM shield's serial out
  delay(100);
}

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
{
  digitalWrite(9, HIGH);
  delay(1000);
  digitalWrite(9, LOW);
  delay(7000);
  Serial.println("Start...");

}

void loop()
{
  if(SIM900.available() >0)
  {
    incoming_char=SIM900.read(); 
    Serial.print(incoming_char);
    if (incoming_char.compareTo("1")){
      //something
    }
  }
 }

after reading the incoming_char i want to compare it to “1”.

this is the error i get:
sketch_apr07a.ino:39:23: error: request for member ‘compareTo’ in ‘incoming_char’, which is of non-class type ‘char’

does anybody ever encounter this?
thanks!
Etay.

if (incoming_char == '1'))

The variable incoming_char is a char variable, not an object, so it can't have a method attached to it (i.e., the is no incoming_char.compareTo() to call). Since it is a single char, you could use AWOL's code, which compares the incoming char against a constant, or you could convert it to an integer and make the compare:

    int value;

    value =SIM900.read() - '0';        // Subtract ASCII zero from the char read and treat as int
    Serial.print(value);
    if (value == 1){
      //something
    }

This works because the ASCII code for 1 is 49 and it is 48 for zero. Therefore 49 - 48 = 1 as an int.