Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: ANSI 'C'. Message-ID: <4600@alice.UUCP> Date: Thu, 21-Nov-85 15:37:40 EST Article-I.D.: alice.4600 Posted: Thu Nov 21 15:37:40 1985 Date-Received: Sat, 23-Nov-85 01:38:44 EST References: <171@watmath.UUCP> Organization: Bell Labs, Murray Hill Lines: 14 > The standard obviously didn't put much thought into anything related to > times. They define type "time_t" as an arithmetic type that represents > the time, and then define a difftime(time_t time1,time_t time2) that > computes the difference between these two arithmetic values. Why the > function? Does the standard have a new arithmetic type on which the > operation of subtraction is not allowed? > And then they define a function gmtime(const time_t *timer) that takes > a pointer to the arithmetic value, which it is not going to change anyway. > Why not just take the value itself instead of the pointer? gmtime takes a pointer rather than the value itself for historical reasons. Before C had long integers, gmtime() took an array of two integers as its argument. Since C does not pass arrays by value, gmtime() actually saw a pointer.