Printing to a printer....I already did a search :)

This is a discussion on Printing to a printer....I already did a search :) within the C++ Programming forums, part of the General Programming Boards category; I'm in the process of writing a program for my father's pizza restraunt to handle order taking and cash handling. ...

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    23

    Question Printing to a printer....I already did a search :)

    I'm in the process of writing a program for my father's pizza restraunt to handle order taking and cash handling. I would like the program to be able to print the food order to a printer we have set up in back by the kitchen.

    After doing a search I can't seem to come up with a concrete answer as to how to do this.

    I tried the following code on my own computer

    Code:
    #include <cstdio>
    
    int main(){
    FILE* fout = fopen("USB0","w");
    if(fout){
    fprintf(fout,"Poor man's printout\f");
    fclose(fout);
    }
    
    return 0;
    }
    This code does nothing, no printout to the screen (which I didn't expect). All I get in my consol window is a "Press any key to continue."

    USB0 is the port that my current printer is on. Is their some information regarding this matter that I can read. I'm not sure of the type of printer or even the port that we're going to use yet. I just want some solid information regarding printing to a printer.

    Thanks for the help.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Not sure that method is OK for USB printers (might be wrong though).......

    You can use the method provided by your OS.....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Printing with printer
    By g4j31a5 in forum C++ Programming
    Replies: 5
    Last Post: 09-14-2006, 01:06 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Printing Debug Without Printer :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 10-15-2002, 02:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21