strcmp
is to compare to strings (sequences of characters), not single characters.
You can just use an equality check for single characters:
if (answers[d] == students[i].testAnswers[d])
Note that if we're talking about boolean values, using an explicit boolean type is probably better than char
.