To compare two arrays, we need to check all the individual element, so in general, we need something like this.
for (size_t i = 0; i < 4; i++) {
if (array_1[i] != array_2[i]) {
// No match.
}
}
In this particular case, you could also consider to use the strcmp function, you have to increase the array sizes by one though, to make room for the terminiation character.
@kwalking
first,
please activate the compiler warnings in your IDE. Your sketch gives you two warnings:
C:\Daten\myrepository\Arduino\Forum no SVN\sketch_sep11a\sketch_sep11a.ino:1:20: warning: initializer-string for array of chars is too long [-fpermissive]
char array_1 [4] = "AAAA";
^~~~~~
C:\Daten\myrepository\Arduino\Forum no SVN\sketch_sep11a\sketch_sep11a.ino:2:20: warning: initializer-string for array of chars is too long [-fpermissive]
char array_2 [4] = "AAAA";
^~~~~~
"AAAA" will need 5 bytes, so it doesn't fit in your variable.