How to writte simple string compare? I new to Arduino and I'm attempting to writte a simple string compare code like this:

void loop() 
{  
  distance(cm);
  delay(200);    
}

void distance(char[3] unit) 
{
  if (unit[] == "cm") 
    Serial.println("cm");
}


Could somebody please advise me how to writte it correctly? 
Thanks in advance!
if (strcmp (unit,"cm") == 0) {

    // matches cm

}


For syntax like this the intellisense in products such as Atmel Studio or Visual Studio can really help. Whilst you still need to understand what you might be looking for the intellisense makes all the available Arduino functions visible from the code. If you install the Arduino plugin then there will be an Arduino reference explorer in both ide's which explains everything.