www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/04/10:08:30

From: "Damian Yerrick" <NOSP AT Musenet@pineight.8m.com>
Newsgroups: comp.os.msdos.djgpp
References: <81uq89$n0l$1 AT news2 DOT tor DOT accglobal DOT net>
Subject: Re: fprintf to HP Deskjet
Lines: 32
Organization: Pin Eight Software <http://pineight.8m.com/>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <qWE04.972$NW1.34504@dfiatx1-snr1.gtei.net>
X-Trace: /bQNuahjXBH31TVbyZVbqjFAKOev2J0HnvKcVrTgb4uUrLqhvqoU7OqNoers6RFP0itQQibzvhv4!jXdI5BatEgPfUra1Oyx4GVvjnSVaDtCpjTKtPXi0G7hrac+GoH8aF9/7kiD2gH/dRm+1DFYc
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Tue, 30 Nov 1999 00:32:22 GMT
Distribution: world
Date: Tue, 30 Nov 1999 00:32:22 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Michel Chassey" <michelc AT primus DOT ca> wrote:
> Hello everyone,
> I invoke gcc : gcc -o f.exe f.c         (for testing)
> Here is the f.c listing :
> #include <stdio.h>
> int main( void )
> {
>  fprintf ( stdprn, "Hello World" );
>  return( 1 );
> }
> The printer goes though the motion of printing then hangs. Lights blink
but
> no printing:
> result blank page.

Change the fprintf() statement to
  fprintf(stdprn, "Hello World\n\x0c");
This inserts a newline (\n) and a formfeed (\x0c), telling the
printer to kick out the paper.

And
  return 1;
in main() generally means that the program ran into
error type 1, however you define that.
If you want to say "no error," say
  return 0;


Damian Yerrick


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019