C++ ofstream Prints a name on the printer

Description

C++ ofstream Prints a name on the printer

#include <fstream.h>
void main()//ww w  . jav a  2  s.  com
{
   char first[20];
   char last[20];
   cout << "What is your first name? ";
   cin >> first;
   cout << "What is your last name? ";
   cin >> last;
   // Send names to the printer.
   ofstream prn("PRN");
   prn << "In a phone book, your name looks like this: \n";
   prn << last << ", " << first << "\n";
   return;
}



PreviousNext

Related