hello dear programmer!
problem: Print a text to printer
prg.language: C
request: any workable solution is welcome
I've already tryde this:...but doesn't work
/*--------------------------------*/
#include <stdio.h>
int main(void) {
FILE* prn;
prn=fopen("/dev/usb/-lp0", "w");
/* -lp0=file attached to printer in Linux O.S. */
if(fopen==NULL) {
puts("Cannot reach the printer!\n");
exit(1);
}
fprintf(prn, "This text should be printed.\n");
return 0;
}
Thanks in advance,
mircea
problem: Print a text to printer
prg.language: C
request: any workable solution is welcome
I've already tryde this:...but doesn't work
/*--------------------------------*/
#include <stdio.h>
int main(void) {
FILE* prn;
prn=fopen("/dev/usb/-lp0", "w");
/* -lp0=file attached to printer in Linux O.S. */
if(fopen==NULL) {
puts("Cannot reach the printer!\n");
exit(1);
}
fprintf(prn, "This text should be printed.\n");
return 0;
}
Thanks in advance,
mircea