English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Programs are running ok in the screen but now I need to print results.

2007-03-20 18:26:10 · 1 answers · asked by JEBETA 1 in Computers & Internet Hardware Printers

1 answers

Hi. From the web:

(From C++): Use the ostream class (cout is an ostream) This should work for both a CONSOLE and a Windows application.

Advantages: Easy printing of simple text.

Disadvantages: Can only print to local printer.

Code:

filebuf fb( "prn:" ); // Filebuf object attached to "prn:"
filebuf fb( "prn:" ); // Filebuf object attached to "prn:"
cout = &fb; // fb associated with cout
cout << "testing"; // Text goes to PRN: not stdout

2007-03-23 03:18:33 · answer #1 · answered by Cirric 7 · 0 0

fedest.com, questions and answers