// drawUSFlag.cpp   A main program that uses the drawings.h library
//                 to draw flags
// P. Conrad   Fall 2004, CISC181


#include <iostream>
#include <fstream>
#include "drawings.h"
using namespace std;

int main(void)
{
  writeGnuplotFile("drawUSFlag.gnuplot", 
		   "drawUSFlag.dat",
		   "drawUSFlag.png",
		   25.0, 50.0);

  ofstream outfile("drawUSFlag.dat",ios::out); // an ofstream can also be used
                                              // as an ostream.
                                              // because of inheritance

  // "cout" is an example of something that is an ostream, but is not
  // an ofstream.    Every ofstream is also an ostream.  But the reverse
  // is not true.   ofstream is a "subclass" of ostream.

  if (!outfile)
    {
      cerr << "Couldn't open file; sorry!" << endl;
      exit(-1);
    }


  drawUSFlag(outfile,1,1,20);

  outfile.close();

  return 0;
  
}
