C++ ofstream Prints to the printer device

Description

C++ ofstream Prints to the printer device

#include <fstream.h>
ofstream prnt;   // Points to the printer.
void main()//from   w w w  .ja  v  a  2s  . co  m
{
   prnt.open("LPT1", ios::out);
   prnt << "Printer line 1\n";     // 1st line printed.
   prnt << "Printer line 2\n";     // 2nd line printed.
   prnt << "Printer line 3\n";     // 3rd line printed.
   prnt.close();
   return;
}



PreviousNext

Related