Check the value of character variable I'm writing some code for Arduino and I'm not sure if I'm checking the value of this character variable correctly. Can you please tell me if this is correct:

const char* front = "front";
const char* back = "back";

eyeballs(front);
eyeballs(back);

void eyeballs(const char* frontOrBack){ 

if (frontOrBack == "front") {
    digitalWrite(frontEyes, LOW);}//end if   
  else if (frontOrBack == "back") {
    digitalWrite(backEyes, LOW);}//end else*/
}
Since you are using C strings (array of characters) instead of the C++ String class, you cannot use the == operator.

Instead, you can use the C style strcmp function, which is also part of the C++ library:

    #include &lt;string.h&gt;
       .
       .
       .

    if (!strcmp(frontOrBack,"front")) {
        digitalWrite(frontEyes, LOW);}//end if   
    else if (!strcmp(frontOrBack,"back")) {
        digitalWrite(backEyes, LOW);}//end else*/
    }