Cannot figure out how to store individual names within a for loop

How can i store student names i tried to use a string array, but they don't store names at a given index in the array.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

void  ProcessOneSection(int& numStudents, int& Passed, 
                            int numQuestion, char Keys[], char answers[], string student[], char pass_fail[], int num_correct[])
{

	bool Pass_or_fail;
	string student1 = " ";

	cin >> numStudents;
	
	for(int i = 0;i < numStudents;i++)
	{
		int num_correct_answers = 0;
		ReadAnswers(answers,numQuestion);
		cin >> student1;
		student[i]  = student1;
		ProcessAnswer(Keys, answers, numQuestion, num_correct_answers, Pass_or_fail);
		num_correct[i] = num_correct_answers;
		if(Pass_or_fail == true)
		{
			pass_fail[i] = 'T';
			Passed++;
		}
		else if (Pass_or_fail == false)
			pass_fail[i] = 'F';
	}
	
}

Topic archived. No new replies allowed.