Problem with file input.

The program will open my file but there is no output to the screen.

Here's the file:

Mike Sullivan, 443-207-1111, 123, 0
Mary Surber, 401-682-2222, 234, 0
Ann Kidd, 302-456-9854, 345, 0
Todd Chaplin, 301-234-0000, 456, 0

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
33
34
35
36
37
 // declare a file pointer and open the cards file 
	ifstream cardInput("cards.txt");
	if (!cardInput)
	{
		cout << "File cards.txt could not be opened. Fatal error." << endl;
		exit(1);
	}

	cout << "File opened. Reading cards..." << endl;
	
	// read the next line from the file
	char Name[30];
	char junk[5];
	char phone[15];
	int CardID = 0;
	int temp = 0;

	cardInput.getline(Name, 30, ',');
	
	// tokenize the line to get the data for class variables

	while (cardInput)
	{
		
		cardInput.getline(Name, 30, ',');
		cardInput.getline(junk, 5, ',');
		cardInput.getline(phone, 15, ',');
		cardInput.getline(junk, 5, ',');
		cardInput >> CardID >> temp;

		Card working(Name, phone, CardID);
		cards[i] = working;
		i++;
	}

	cardInput.close();
well you arent printing it out anywhere
So how would I print it out? I think I have tried just about everything except the right answer. I have been trying to figure it out for the last couple of days. Thank you for the reply.
Topic archived. No new replies allowed.