or you can do a search on the board for the myriad of examples on printing that look similar to this....
not to mention... eight or so posts down is a question how to save and print. There are a lot of resources here that will help you, and most likely people before you have asked a similar question. Try the search feature on this board... there is a wealth of knowlege there.
using namespace std ;
char printer = "LPT1:";
ofstream prnt (printer);
cout << "ERROR-Unable to open " << printer << '\n' ;
return 1 ;
cout << "Type the text you wish to have printed. You must use "
<< "\nyour own returns as there is no text wrapping other than "
<< "\nthat which the printer will do at the end of page. Though, "
<< "\nthis may lead to words being cut in half. This simple "
<< "\nprogram could be made much better utilizing iomanip for text "
<< "\nformatting, but it shows you the basics of opening a printer "
<< "\nport. " << endl << endl
<< "Press a '#' and return when you are ready to print... " << endl
<< endl << endl;
while (character != '#')
if(character != '#')
prnt << '\r' << '\f' ; // return and eject the last page from the printer