String Comparison Result I've following code:

char a[5] = "bang";
char b[5] = "";
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
  if (a != b){
  for(int i=0; i&lt;4; i++){
      b[i] = a[i];
    }
    Serial.print("b: ");
    Serial.println(b);
    Serial.println("Not Equal");
    delay(1000);
  }
  else{
    delay(1000);
  }

}


Why the output is: 

b: bang
Not Equal
b: bang
Not Equal 
b: bang
Not Equal


Shouldn't a and b equal after first loop?
As Matej already mentioned, use:

strcmp(a, b) != 0


If you compare a and b, what you are actually doing is comparing two pointers (to the text characters). These pointers a and b are stored at different locations in memory, although the content itself can be the same.

See it as this:

a   memory location 0x12345: "Bang"
b   memory location 0x1234A: "Bang"    (5 memory locations further)