Char array comparison

I'm, sorry for all the questions. But I have one more problem. I finally found out how to compare my two arrays(I hope this is correct), but now I need to make a calculation of wrong answers compared to right answers. The student array holds the input of the user, and the teachers array holds the correct answers, but I'm having trouble figuring out how to assign these wrong answers a number.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
while( answer< Student_Array)
	{
		if( Student_Exam[answer] != Teachers_Exam[answer])
		{
			arraysequal= false;
			answer++;
		}
		else
		{
			cout<< "#"<< (answer+1)<< "was a Correct Answer!"<<endl;
			answer++;
		}		
	}
Last edited on
Let me know if you need more of my program, didnt want to make a huge mess on the page.
You could make a separate counter for wrong and right answers and the program increments one or the other depending on the result of your check. That is, in addition to printing that an answer was correct, increment the counter or the number of right answers.
Topic archived. No new replies allowed.