

#include <iostream>
#include <fstream>
using std::cout;
using std::cerr;
using std::endl;
using std::ifstream;
using std::ios;


#define INPUT_LINE_LEN 1024   // no semicolon on a #define

int main(int argc, char *argv[])
{

  if ( argc != 4)
    {
      cerr << "Usage: " << argv[0] << " filename month day  ";
      cerr << "  This will print all people in the file whose "
	   << "birthday is on that date";
      exit(1);  // error condition available at unix cmd line -- echo $?
    }

  ifstream inf(argv[1],ios::in);
  
  if (!inf)
    {
      cerr << "Error: could not open " << argv[1] << endl;
      exit(2);
    }

  // now we know that we have an open file on inf
  // so read all lines from the file

  
  char inputLine[INPUT_LINE_LEN];

  
  inf.getline(inputLine, INPUT_LINE_LEN);
  while (!inf.eof())
    {
      // process the inputLine
      // specifically, use strtok to get the stuff

      cout << inputLine << endl; // temporary to make sure we are reading ok



      inf.getline(inputLine, INPUT_LINE_LEN);
    }

}
