Xref: utzoo comp.unix.sysv386:8347 comp.lang.c:39518 Newsgroups: comp.unix.sysv386,comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!hybrid!scifi!bywater!uunet!kithrup!sef From: sef@kithrup.COM (Sean Eric Fagan) Subject: Re: time(0L) - history of a misconception (was Re: SCO password generator) Organization: Kithrup Enterprises, Ltd. Date: Wed, 22 May 1991 18:51:34 GMT Message-ID: <1991May22.185134.376@kithrup.COM> References: <1991May14.040042.15199@jpradley.jpr.com> <588@sherpa.UUCP> <1141@mwtech.UUCP> In article <1141@mwtech.UUCP> martin@mwtech.UUCP (Martin Weitzel) writes: >In article <588@sherpa.UUCP> rac@sherpa.UUCP (Roger Cornelius) writes: >> long seed = time(0L); > ^^--------- wrong > time((long *)0); > ^^^^^^^^^--- right >Note that the argument to the time system call is a `long *', aka >pointer to long. Repeat after me: POINTER to long. On the other hand, if you have an ansi-conformant compiler, and a prototype is in scope, then either solution will work properly. -- Sean Eric Fagan | "I made the universe, but please don't blame me for it; sef@kithrup.COM | I had a bellyache at the time." -----------------+ -- The Turtle (Stephen King, _It_) Any opinions expressed are my own, and generally unpopular with others.