time(2 or 3)

Jay Batson jay at isis.UUCP
Wed Jun 18 01:51:45 AEST 1986


In article <2021 at umcp-cs.UUCP> chris at maryland.UUCP (Chris Torek) shows
how in article <798 at isis.UUCP> jay at isis.UUCP (Jay Batson) I was wrong
with the following statement (among other comments):
>>	/* ok, first get ahold of the number of seconds since Jan 1, 1970 */
>>	somevar1 = time(0);
>
>       Specifically, time() is a function returning long, taking
>a _pointer_ to long...;
>Change to:
>	...
>	somevar1 = time((long *) 0);

Yes, I do feel like a total idiot, and do feel soundly trounced.  Of course
Chris is right;  I just ':r some_prog_of_mine' that _worked_(!), and failed to
exercise the cardinal rule - don't give advice until you _verify_ what
you are saying with the _newest_ manual.  Henceforth, I vow to get "A's" instead
of "B's" in class, and never make another mistake again.  Ever.  In my life.
And then some.  (You get the point).

Of course, it helps my case a bit that _my_ manual (albiet an old V7)
has the following in time(2):  (honest)

	long time(0)          <<<< this is what I recommended.

	long time(tloc)       <<<< this is what Chris recommended
	long *tloc;

	#... (more stuff)


Thanks for clearing up the "error" Chris.

--------

"OK, so now, after it gets dark Lancelot and I will jump out of the rabbit, and
 take the castle by supr........ oh."

Jay Batson
{seismo,hplabs}!hao!isis!jay



More information about the Comp.lang.c mailing list