// Kyle Erin 


#include <iostream>
#include <fstream>
using namespace std;


int readArray(int a[], int size, const char * const filename)
{
 
  ifstream inf(filename,"ios::in");
  
  
  if (!inf)  // originally was ( inf.eof() )
    {
      cerr << "Unable to open file" << endl;
      exit(1);
    }
  int count = 0;
  
  int nextNum;
  inf >> nextNum;

  while(!cin.eof())
    {
      if (count >= size)
	{
	  // don't forget the endl! PTC
	  cerr << "Too many numbers in input file " << endl; 
	  exit(2);
	}

      a[count] = nextNum;
      count++;
      inf >> nextNum;
    }

  return count;
  
}


