Thread: printing output from prog

  1. #1

    printing output from prog

    I am using borland c++4.5 compiler.
    Can anyone tell me how to set up the compiler to use my printer from within my code. Am I right in thinking it is somewhere within the options environment settings?

  2. #2

    a bit less vague

    Sorry about the previous question.
    I have code in my program that should access my printer:-
    fprintf(prn_ptr,"Hello"); for example.
    The printer has been opened by prn_ptr=fopen("LPT1","wt");
    and I have tried prn_ptr = fopen("PRN","wt"); but I cannot open the printer (fopen is returning an error).
    My printer is connected via USB, I am using Win98SE. What should I be setting up within Borland to make this work?

  3. #3
    train spotter
    Join Date
    Aug 2001
    near a computer
    Try changing "LPT1" to the name of the default printer in Windows.

    Been a long time since I used DOS.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C# Printing Problem
    By silverlight001 in forum C# Programming
    Replies: 0
    Last Post: 03-23-2009, 01:13 AM
  2. printing output
    By TAboy24 in forum C Programming
    Replies: 2
    Last Post: 12-07-2007, 12:41 AM
  3. Printing to file / Output issues
    By Roflcopter in forum C++ Programming
    Replies: 19
    Last Post: 10-11-2007, 07:38 PM
  4. Connecting input iterator to output iterator
    By QuestionC in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2007, 02:18 AM
  5. sorting output on student info program
    By indigo0086 in forum C++ Programming
    Replies: 2
    Last Post: 11-05-2002, 11:29 AM