#include <stdio.h>
#include <stdlib.h>

void double_space(FILE *, FILE *);
void prn_info(char *);

main(int argc, char **argv)
{
  FILE *ifp, *ofp;

     if (argc != 3) {
       prn_info(argv[0]);
       exit(1);
     } /* END if */

   ifp = fopen(argv[1],"r");   /* open for reading */
   ofp = fopen(argv[2],"w");   /* open for writing */
   double_space(ifp,ofp);
   fclose(ifp);
   fclose(ofp);
} /* END main() */

void double_space(FILE *ifp, FILE *ofp)
{
   int c;

     while ((c = getc(ifp)) != EOF) {
       putc(c, ofp);
       if (c == '\n')
	 putc('\n',ofp);  /* found a newline - duplicate it */
     } /* END while */
} //END double_space()


     void prn_info(char *program_name)
       {
	 printf("\n%s%s%s\n\n%s%s\n\n",
		"Usage: ", program_name, " infile outfile",
                "The contents of infile will be double-spaced ",
                "and written to outfile.");
       }   
                                


