I have this coded out but it keeps giving me the error message "ifstream" does not have a type. I don't know what to do, sigh. Any help would get appreciated.
const int MAXSIZE = 100;
double votes[MAXSIZE]; // declaration for array
double vote;
int count = 0;
double total = 0.0;
double average;
ifstream myFile; // declaring input file
myFile.open ( "votes.txt" );
if ( !myFile )
{
cout << "Error opening input file: votes.txt";
system("PAUSE");
exit(1);
}
while ( !( myfile.eof ( ) ) )
{
myFile >> vote >> ws;
total += vote;
votes[count] = vote;
count++;
} // end while
if ( count != 0 )
average = total / count;
else
average = 0.0;
myFile.close ( );