Thread: How to print using C++

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    79

    How to print using C++

    Hi. For all those who know BASIC, you might remember there is an LPRINT statement that is used to print a line on paper.

    e.g. LPRINT "Hello World" would print "Hello World" on paper using the printer.

    Is there a similar statement/function which does this in C++?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Code:
    #include <cstdio>
    
    int main(){
    FILE* fout = fopen("LPT1","w");
    if(fout){
    fprintf(fout,"Poor man's printout\f");
    fclose(fout);
    }
    
    return 0;
    }

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    Note:LPT1 is the DOS device for the 1st printer port.I guess you could access other devices like this-?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. merging linked lists
    By scwizzo in forum C++ Programming
    Replies: 15
    Last Post: 09-14-2008, 05:07 PM
  2. Personal Program that is making me go wtf?
    By Submeg in forum C Programming
    Replies: 20
    Last Post: 06-27-2006, 12:13 AM
  3. Scope And Parameter Passing
    By djwicks in forum C Programming
    Replies: 6
    Last Post: 03-28-2005, 08:26 PM
  4. What kind of programs should I start writing?
    By Macabre in forum C++ Programming
    Replies: 23
    Last Post: 04-12-2003, 08:13 PM
  5. Replies: 1
    Last Post: 07-31-2002, 11:35 AM