Code:
if(strcmp(answer[i].answers[x], answerKey[0].answersToQuestions[x]) == 0)
{
printf("%c",answer[i].answers[x]);
printf("%c\n",answerKey[0].answersToQuestions[x]);
}
strcmp is used to compare strings. if you want to compare single character just do it as you do with integer values:
Code:
if(answer[i].answers[x] == answerKey[0].answersToQuestions[x])
{
printf("%c",answer[i].answers[x]);
printf("%c\n",answerKey[0].answersToQuestions[x]);
}
Why do you need to print the same value twice?