Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: michael@mail.ast.cam.ac.uk (Michael Lemke)
Subject: Re: Interesting Fortran Behaviour
Date: 25 Feb 1994 10:49:37 GMT	[thread overview]
Message-ID: <2kkl41$4cn@lyra.csx.cam.ac.uk> (raw)
In-Reply-To: CLqA3L.Lxv@wst.edvz.sbg.ac.at

In article <CLqA3L.Lxv@wst.edvz.sbg.ac.at>,
Wesp Gerhard <gwesp@wst.edvz.sbg.ac.at> wrote:
> Consider the following little C and Fortran programs:
>--- 4711.c -------------------------
>#include <stdio.h>
>
>void main()
>{
>  int i;
>  for(i= 1; i <= 4000; i++)
>    printf("4711.47114711\n");
>}
>------------------------------------
>This just prints the number 4711.47114711 to stdout 4000 times and then 
>terminates.
>
>--- crunch.f -----------------------
>      program crunch
>
>      integer i
>      double precision a
>
>      do 4711 i= 1, 4000
>        read *, a
>4711  continue
>
>      print *, 'read 4000 numbers'
>
>      end
>------------------------------------
>This trys to read 4000 numbers from stdin, and, if successfully, prints
>the message 'read 4000 numbers' to stdout and terminates.
>
> So what would you expect if you connect those two programs by a pipe, e.g.
>"4711 | crunch"? Well, 4711 should produce 4000 numbers, crunch should con-
>sume them and happily terminate with 'read 4000 numbers'.
> And that's exactly what it does on a good old Tektronix m88k workstation.
>

And that's exactly what it does on a Sun workstation.

Michael
-- 
Michael Lemke
Institute of Astronomy, Cambridge UK
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])


      parent reply	other threads:[~1994-02-25 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-02-24 12:16 Interesting Fortran Behaviour Wesp Gerhard
1994-02-24 17:38 ` Jim Brown
1994-02-25 10:49 ` Michael Lemke [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox