Help reading numbers

I'm trying to read the numbers from this file through a function, however I can't get it to work, any hints are appreciated.

This is the file:

Mickey Mouse S45 78Y W91
Minnie Mouse HH95DF E92DD P88D
Jack Robinson
Jimmy Johnson SSF54S W89W U66T DD44S DD21S
Donald Duck WQ72Q A81B EE89W


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
void getScore(ifstream &fin, double &test, double &counter, double &testtotal)
	{
		

		counter = 1;
		fin >> test;
		while (test != '\n')
		{
			fin >> test;

			testtotal += test;

			while (fin.fail())
			{
				fin.clear();
				fin.ignore(1, '\n');
				fin >> test;
			}

			cout << "Test#" << counter << " " << test << endl;
			counter++;

		}

	}
Topic archived. No new replies allowed.