View Single Post
Old 09-05-2005, 03:38 PM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Printing File Data (Via a Printer)

I am currently making a program that will read information from a file, but, i would also like to allow the user to print the current record(s) from the file via a printer. How can this be done.

Many Thanks

Here's the coding i have so far:

Quote:
#include <iostream.h>
#include <fstream.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>

int main(void)
{
int id;
char name[50];
char next;

ifstream data (".\\data.txt");
do
{
clrscr();
data >> id;
data >> name;
cout << "ID: " << id << endl;
cout << "Name: " << name;
cout << "\n\nShow Next? Y/N: ";
cin >> next;
next = toupper (next);
} while (next == 'Y');
data.close();
return 0;
}
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote