String str1 = "CCCP";
char str3[] = "CCCP";
// Tests to see if str1 is equal to str3
void setup() {
Serial.begin(9600);
if(str1.equals(str3) == true) {
Serial.println("Equal"); // They are equal so this line will print
}
else {
Serial.println("Not equal");
}
if(str1.equals("CCCP") == true) { // Testing directly
Serial.println("Equal"); // They are equal so this line will print
}
else {
Serial.println("Not equal");
}
}
void loop() {
// Nothing for loop()
}
|