*BSD News Article 74635


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!inquo!news.seinf.abb.se!nooft.abb.no!Norway.EU.net!EU.net!newsfeed.internetmci.com!demos!news.spb.su!ssrun.arcom.spb.su!adn.spb.ru!usenet
From: "Serg B. Khvatov" <xbatob@adn.spb.ru>
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: C Programming Help
Date: Thu, 25 Jul 1996 10:14:26 +0400
Organization: Techno-SPb
Lines: 23
Message-ID: <31F710C2.41C67EA6@adn.spb.ru>
References: <Edina1996Jul23.202436.23721@news3.idirect.com.compulink.com> <Pine.BSI.3.93.960724124328.254f-100000@babel.magic.fr>
NNTP-Posting-Host: virgo.adn.spb.ru
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0b4 (X11; I; BSD/OS 2.0 i386)

Edouard CORREIA wrote:
> > Programming the following code does not show anything on the screen,
> > why??
...
> >   printf(Hello Test");
> implicit exit does not flush any pending output so correct your program in
> this way:
> >   printf(Hello Test\n");

Right solution but wrong explanation :-)

Implicit exit (and exit() too) does flush all output
I think your program does print
but the ouutput is erased by shell prompt.
Try:
	a.out; sleep 10
to check this.

--
Serg B. Khvatov          ==========
Phone:(812)1648655             //
      (812)3147014            //echno
mailto:xbatob@adn.spb.ru     // St-Petersburg