Code:
/*
Program:
Printer.c
Purpose:
Demonstrates how to use the printer
in your programs.
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *printer = fopen("LPT1","w");
FILE *fp;
char str[256];
char buf[BUFSIZ];
printf("File name?\n ");
scanf("%s",str);
fp = fopen(str,"r");
if(!fp)
{
printf("File does not exist\n");
return -1;
}
while( fgets(buf,sizeof buf,fp) != NULL )
{
printf("\nPrinting..\n");
fprintf(printer,"%s",buf);
}
fprintf(printer,"\f");
return 0;
}
....if any of that helps.