input from file to string array

I have this file:
1
2
3
4
5
4
2WE34     12 1 2 3
E324R     1  1 1 1
5QAE2     2  5 4 4
QWE34     0  0 0 0


The first entry is how many types of units. The first column is an employee ID. I need to read the ID's in a 1-d string array. My problem is I'm having problems just reading the ID's only. First I used cin but that will input everything in the array. Next I tried getline but get a compilation error. Here's the code of the function:
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
29
30
31
32
void read_2_matrix(int& nTests, string ID[])
{
	ifstream ifile;
	ifile.open("test_score.txt");

    if (ifile.fail())
    {
        cout << "Failed to open input file." << endl;
        exit(1);
    }
	
	ifile.get(nTests);
	
	while(!ifile.eof())
    {
		
		for(int i=0; i<50; i++)
			
			ifile.getline(ID[i], 5);
			
	}
	
	for(int i=0; i<50; i++)
	{
		cout << ID[i] << ' ';
		cout << endl;
	}
	


	
}


Thanks for the help!
Topic archived. No new replies allowed.