windows - Printing string text in C does not print -


i trying print specific string line printer. try run snippet nothing prints out. looking @ list of pending jobs printer, , nothing shows when run code.

i can print documents fine word, printer available.

can hint @ problem may be?

#include <stdio.h> #include <stdlib.h> int main() {  file* printer = 0;  if(( printer = fopen("lpt1", "a+")) == null)  {     puts("error opening printer");  }  char* text = "this test printing";   if ( (fprintf(printer, "%s" , text) ) < 0  ){      perror("printing error");  }    fflush(printer);  fclose(printer);  return 0; } 

i think misunderstanding code. code submitted writes string "this test printing" file in same directory called "lpt1".

what wanting write out "/dev/lpt1", , should able test running

echo "this printed text" >/dev/lpt1 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -