printing output from prog

This is a discussion on printing output from prog within the C Programming forums, part of the General Programming Boards category; I am using borland c++4.5 compiler. Can anyone tell me how to set up the compiler to use my printer ...

  1. #1
    Unregistered
    Guest

    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?
    Thanks.

  2. #2
    Unregistered
    Guest

    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
    Location
    near a computer
    Posts
    3,859
    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-06-2007, 11:41 PM
  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, 10:29 AM

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