Code for Program to illustrate printing data on the printer in C++ Programming
#include<iostream.h> #include<fstream.h> #include<stdlib.h> #include<conio.h> main(int argc,char *argv[]) { clrscr(); if(argc!=2) { cout<<"\n Format : File - Print File Name "<<endl; exit(0); } char ch='\0'; ifstream input_file; ofstream output_file; input_file.open(argv[1]); output_file.open("PRN"); // or LPT1while(input_file.get(ch)!=0); output_file.put(ch); getch(); return 0; }
No comments:
Post a Comment