Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!linus!decvax!harpo!eagle!allegra!alan From: alan@allegra.UUCP Newsgroups: net.lang Subject: Re: I/O operations in programming languages Message-ID: <1796@allegra.UUCP> Date: Tue, 30-Aug-83 12:54:33 EDT Article-I.D.: allegra.1796 Posted: Tue Aug 30 12:54:33 1983 Date-Received: Wed, 31-Aug-83 22:03:37 EDT References: <666@mit-eddie.UUCP>, <110@csd1.UUCP> Organization: Bell Labs, Murray Hill Lines: 33 All facetiousness aside, would somebody please show me where my reasoning has gone astray here? My best guess as to why people say that C has no I/O is that all its I/O is performed with function calls, but I can't see how there being no separate syntax for the I/O constructs matters one hill of beans. We certainly don't say that FORTRAN has addition but does not have the absolute value operation simply because the latter is a function call while the former uses infix notation; or do we? In Fortran, the absolute value function is part of the definition of the language. It is a built-in function. If your Fortran compiler does not supply it, then it's not a correct and complete compiler. So it's fair to say that Fortran has an absolute value operation. In C, on the other hand, no I/O operations exist in the definition of the language. From "The C Programming Language" by K & R: Finally, C itself provides no input-output facilities: there are no READ or WRITE statements, and no wired-in file access methods. So, your C library (not your C compiler) may include "printf", but it doesn't have to. With or without "printf", it's still C. Do you now understand why people say C has no I/O? Alan Driscoll Bell Labs, Murray Hill