I'm trying to take some information from a file and input it into an array so that it can be output on the screen, but I can't get this to work. Here's the kicker though....the file has to allow 100 test scores, but must end when it hits -999....any ideas?
File
53
55
55
65
78
78
78
80
85
85
92
92
92
95
95
95
95
-999
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
void main()
{
ifstream scores;
int i, Quiz[100];
string file;
cout << "Enter name of file" << endl;
cin >> file; file += ".txt";
scores.open(file.c_str());
if(scores)
{
for (i=0;i < 101 ;i++)
if (Quiz[i] != -999)
{
cout << Quiz[i] << endl;
}
else
cout << "Error";
}
}