help to new C programmer with time.h

pf at geech.ai.mit.edu pf at geech.ai.mit.edu
Sat Mar 2 03:20:24 AEST 1991


jik at athena.mit.edu (Jonathan I. Kamens) wrote:
>   First of all, this is an OS-specific question, not a C question, because
>the C language does not define how to get the time; any functions for getting
>the time in C are OS-specific library functions, not standard C functions. 
>Since the functions and structures you are using appear to me to be Unix
>library structures and functions, I have cross-posted my response to

Sure about this?  struct tm, time_t, and localtime are in K&RII, p256.
They look like part of the standard library to me.  A nonstandard
approach would be assuming that time_t is a longword containing the
number of seconds since whenever.  But using time_t as an abstract
datatype seems allowed by K&R2 (which, I know, is not the ANSI spec).
--
Paul Falstad, pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
"So how DO you delete a file called - ?"  For viewers at home, the answer
is coming up on your screen.  For those of you who wish to play it the hard
way, stand upside down with your head in a bucket of piranha fish.



More information about the Comp.unix.programmer mailing list