Article View: net.micro.mac
Article #6287Re: Aztec 1.06H.1 disk & nested func calls
From: Robert N. Berlinger
Date: Tue, 01 Jul 1986 20:59
Date: Tue, 01 Jul 1986 20:59
25 lines
1333 bytes
1333 bytes
> I was doing a call like:
>
> strcpy(s, ctime(time((time_t)NULL)));
>
> which apparently doesn't work right most of the time (I got address errors
> when it died). Breaking the function calls apart, as in:
>
> time(&foo);
> bar = ctime(&foo);
> strcpy(s, bar);
>
> (where foo, bar, s, etc. all have the appropriate definitions) seems to have
> fixed the problem.
These are not equivalent! "time((time_t)NULL)" does not return a
pointer, it returns a time_t. Ctime, however, does expect a
pointer, which you properly passed in your second version. There
is no way to nest them, in this case.
--
Robert Berlinger
Systems Analyst
Albert Einstein College of Medicine
UUCP: ...{philabs,cucard,pegasus,ihnp4,rocky2}!aecom!naftoli
Compuserve: 73047,741
Technical Details
Message-ID:
<347@aecom.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!ut-sally!seismo!cmcl2!philabs!aecom!naftoliReferences:
<2256@cbosgd.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!ut-sally!seismo!cmcl2!philabs!aecom!naftoli From: naftoli@aecom.UUCP (Robert N. Berlinger) Newsgroups: net.micro.mac Subject: Re: Aztec 1.06H.1 disk & nested func calls Message-ID: <347@aecom.UUCP> Date: Tue, 1-Jul-86 16:59:04 EDT Article-I.D.: aecom.347 Posted: Tue Jul 1 16:59:04 1986 Date-Received: Thu, 3-Jul-86 05:55:59 EDT References: <2256@cbosgd.UUCP> Distribution: na Organization: Albert Einstein College of Medicine Lines: 25