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
|
bool ReadPowerballNumbers(vector<Powerball> vNumbers)
{
string trash;
ifstream openFile;
openFile.open(FILE_IN);
if (openFile.is_open())
{
getline(openFile, trash, ',');
getline(openFile, trash, ',');
getline(openFile, trash);
for (int i = 0; i < 650; i++)
{
Powerball numbers;
getline(openFile, trash, ',');
getline(openFile, numbers.one, ' ');
getline(openFile, numbers.two, ' ');
getline(openFile, numbers.three, ' ');
getline(openFile, numbers.four, ' ');
getline(openFile, numbers.five, ' ');
getline(openFile, numbers.powerball, ',');
vNumbers.push_back(numbers);
}
openFile.close();
return true;
}
else
{
cout << "\n\t\tError! Could not open file." << endl;
return false;
}
}
|