string copare

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
  // blurt out contents of new SMS upon receipt to the GSM shield's serial out

void SIM900power()
// software equivalent of pressing the GSM shield "power" button
  digitalWrite(9, HIGH);
  digitalWrite(9, LOW);


void loop()
  if(SIM900.available() >0)
    if (incoming_char.compareTo("1")){

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?

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 - '0';        // Subtract ASCII zero from the char read and treat as int
    if (value == 1){

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