Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Printing from Visual C++ output

  1. Oct 14, 2008 #1
    I need to be able to print the output from my c++ program, which obviously comes up in a dos screen. Is there an easy way to print this without writing it into the code? Any help would be greatly appreciated.
  2. jcsd
  3. Oct 14, 2008 #2


    User Avatar
    Science Advisor
    Homework Helper

    myprogram.exe > result.txt
    print result.txt or double click on result.txt and select print
  4. Oct 14, 2008 #3
    excellent, thanks!
  5. Oct 15, 2008 #4


    User Avatar

    Staff: Mentor

    IIRC in good ole times it was something like myprogram.exe > prn or myprogram.exe > lpt1. No idea if it works in dosbox.
  6. Oct 15, 2008 #5


    User Avatar
    Science Advisor
    Homework Helper

    Not directly (at least for most simple laser printers)
    You can share the regular system printer using network shares and then connect lpt1 to that printer.
    net use lpt1: \\mymachine\myprinter

    You can then print directly to lpt1: even if it is a gdi/winlaser on a usb port.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook