// readRadioHead.cc  P. Conrad CISC181 02/21/06
// read data from radiohead.csv into an array of structs


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

const int ALBUM_NAME_LEN = 30;
const int TRACK_NAME_LEN = 30;

struct AlbumData_S
{
  char nameOfAlbum[ALBUM_NAME_LEN];
  int yearReleased;
  char favoriteTrack[TRACK_NAME_LEN];
  int numTracks;
};

#define INPUT_FILE_NAME "radiohead.csv"

int main(void)
{

  // ifstream constructor

  ifstream infile(INPUT_FILE_NAME, ios::in );

  // check for errors on opening the file

  if (!infile)
    {
      cerr << "Could not open file " << INPUT_FILE_NAME << endl; 
      return 1; // because we had an error---could also use exit(1);
    }


  // next time add infile.getline here @@
  while (!infile.eof()) 
    {

      // add code to process the line just read @@@

      // next time add infile.getline here @@
    }
  

  return 0;
}


