Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.lang.c Subject: Re: C vs. FORTRAN (was: What should be added to C) Message-ID: <901@ttrdc.UUCP> Date: Sat, 31-May-86 01:56:13 EDT Article-I.D.: ttrdc.901 Posted: Sat May 31 01:56:13 1986 Date-Received: Sun, 1-Jun-86 10:11:09 EDT References: <1594@ecsvax.UUCP> <477@cubsvax.UUCP> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 34 In article <477@cubsvax.UUCP>, peters@cubsvax.UUCP (Peter S. Shenkin) writes: >In article kwh@bentley.UUCP (KW Heuer) writes: >>Another advantage of FORTRAN is implicit DO loops in I/O statements, and the >>related ability to use (constant, at least) repeat counts in FORMATs. I had >>a program that made this painfully clear when it was translated from FORTRAN >>to C. >I agree; on the other hand, what C has over FORTRAN in this regard is the >ability to keep writing on the same line in subsequent calls to printf(); >that is, to *not* insert a newline after WRITEing. >Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027 >{philabs,rna}!cubsvax!peters cubsvax!peters@columbia.ARPA This is probably as much OS-dependent (actually filesystem/device driver dependent) as it is language dependent. Fortran I/O seems to be better suited to record-oriented OS's such as VMS, while C I/O seems to be better suited to stream-oriented OS's like UNIX. True, Fortran 77 doesn't offer a way to keep printing on the same output line once a given WRITE statement has finished, but a (common?) extension (maybe it will be official in a Fortran 88?) is to allow the edit descriptor '$' in a format statement to signify that the current record has not yet been completely written. VMS Fortran and UNIX f77 both support this, and I must say that UNIX f77 does it better in that it supports this kind of operation when writing to files or to a terminal, while VMS Fortran can only support it when writing to a terminal (being locked into a record-oriented filesystem treatment--once you've finished writing to that record, that's it buddy). -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, vax135}!ttrdc!levy