Reading two arrays from a text file

Hello everyone,
I am currently working on a program that is suppose to allow me to validate if a user is a member of a store or not by reading the user input from a text file. In order to do this I have developed the following code. The text file involves two arrays.
In the text fie I have:

3
Titanic
Kate Winslet
Leonardo Dicaprio
Cameron
Cameron
20th Century Fox
2
Jerry MacGuire
Tom Cruise
Renne Zellwegger
Brooks
Crowe
United Artists
18
Rain Man
Dustin Hoffman
Tom Cruise
Johnson
Levinson
United Artists
2

Donald Duck 1
Mickey Mouse 2
Minnie Mouse 3
Goofy Dog 4

My code is as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int main()
{
        string member[10], fname, lname, memID, tagetID;
	cout<<"Enter member ID: ";
        cin >> targetID;
	ifstream memberFile("Hey.txt");
	for(int i = 0; i < 10; i++)
	{
		memberFile >> fname >> lname >> memID;
		member[i] = fname +" "+ lname +" "+ memID;
		if(targetID == memID)
                   cout << "Welcome:" << fname;
                else
                   cout << "Not a valid ID";
	}
	system("PAUSE");
}

When I run the program, it either stops at the first input and reads that out as the first now, or provides no output at all. Is there anyway for me to read off the two arrays separately, so that I can read the end where the member data is?

Last edited on
One thread per question, please:

http://cplusplus.com/forum/general/55813/
Sorry about that. I'm new here and I thought it would be a good way to get a response. I'll delete the other now.
Topic archived. No new replies allowed.