[ back to toc ]

printing output from Borland 4.52

Date: 2002/04/03 10:22

Q:
Hi Peter
I hope you can shed some light on my problem.
I am new to C programming. I have version 4.52 of Borland C++ and a
Cannon BJC-4200. when I use fscanf as below the print goes to the screen
not to the printer.

#include <stdio.h>

int main(void)
{
FILE *stream;
int i = 100;
char c = 'C';
float f = 1.234;

/* open a file for update */
stream = fopen("LPT1", "w");
/* write some data to the file */
fprintf(stream, "%d %c %f", i, c, f);

/* close the file */
fclose(stream);
return 0;
}
Can you suggest a way out please.
A:
fscanf actually reads from a file.

Other than that I do not know how you should open a file stream to your
printer.

regards,
Peter

[ back to toc ]