Thread: can you help me?

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    4

    Question can you help me?

    HI
    this is chaitenya yadav.


    i have develop a c project in which it is displaying report on monitor screen but i want that it should be printable on the printer.

    Means i want to take a print out on paper of my report which is displaying on monitor screen.

    OS Used : Window 98
    compiler Used : Turbo c3
    type : Dos

    thnx
    chaitenya yadav
    Last edited by chaitenyay; 07-10-2006 at 08:57 AM.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    putchar(), puts(), printf() all work.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    what do you mean by "print"? like print to where? the screen (stdout)? a device? please elaborate...

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  4. #4
    Registered User
    Join Date
    Jul 2006
    Posts
    4
    i have develop a c project in which it is displaying report on monitor screen but i want that it should be printable on the printer.

    Means i want to take a print out on paper of my report which is displaying on monitor screen.

    thnx
    chaitenya yadav

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Which OS ?
    Which compiler ?
    What kind of program (DOS / Console / windows-GUI ) ?

    What have you tried so far, like for example you can print to the screen, but now you want to add printer output as well?

    Or are you stuck at "hello world" ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Jul 2006
    Posts
    4
    Quote Originally Posted by itsme86
    putchar(), puts(), printf() all work.
    hi this is chaitenya yadav
    i want to know how we can print a report on paper, which is genereted by c programm.
    c program is developed on turbo c3 and OS used Window 98.

    thnx

    chaitenya yadav

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Right click on the console window and select all. Press enter to copy everything onto the clipboard. Use your favorite word processor to paste and print.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > c program is developed on turbo c3 and OS used Window 98.
    Mmm, old enough that this might work

    Code:
    FILE *fp = fopen ( "prn:", "w" );
    if ( fp != NULL ) {
      fprintf( fp, "Hello world\n\f" );
      fclose( fp );
    } else {
      perror( "Couldn't print\n" );
    }
    Also try the following filenames, if that doesn't work
    "lpt:"
    "prn"
    "lpt"

    After each test, check to see whether it created a file with that name in the current directory (if it does, then it's the wrong filename for the printer).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed