I have found many code examples on the Net, like the one below, but cannot get any one of them to work. (I guess LPT1 is outdated.) Plese help.
Code:#include <stdio.h>
#include <stdlib.h>
int main ( void )
{
FILE * Printer = fopen("LPT1", "w");
FILE * FilePointer;
char str[256];
char buf[BUFSIZ];
printf("File name?\n");
scanf("%s", str);
FilePointer = fopen(str, "r");
if( !FilePointer )
{
printf("File does not exist\n");
return -1;
}
while( fgets ( buf, sizeof buf, FilePointer ) != NULL )
{
fprintf(Printer, "%s", buf);
}
printf("\nPrinting..\n");
fprintf(Printer, "\f");
return 0;
}