Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #102730

Re: Could you explain what meanings are in this time help contents?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Could you explain what meanings are in this time help contents?
Date Sun, 29 Jan 2017 13:26:07 -0800
Organization None to speak of
Lines 40
Message-ID <lna8a9blsg.fsf@kst-u.example.com> (permalink)
References <58fe223e-7877-4fab-a883-cbaf3ae7d809@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="0fd733d9f8cc5cb46740a4e887498fc9"; logging-data="28711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HakBo6K568BPshMtPFD9o"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:AF0lZbFjqlLmtkzSwjCy0ojNhAQ= sha1:9s7JWrj7ootHVEI0MEPmOn5um3c=
Xref csiph.com comp.lang.c:102730

Show key headers only | View raw


fl <rxjwg98@gmail.com> writes:
> I want to learn ctime usage. Accidentally see the following link:
>
> http://ps-2.kev009.com/wisclibrary/aix51/usr/share/man/info/en_US/a_doc_lib/libs/basetrf1/ctime.htm#SPTA0909BAC
>
> It is noticed that the first line in each pair has no ';' at the end.
> It is puzzling to me for their meanings.
> There are three same lines beginning with 'const'.
>
> Could you explain to me what each pair is for?
[...]
> #include <time.h>
>
>
> char *ctime ( Clock)
> const time_t *Clock;

This is part of an old-style (pre-ANSI) function declaration.

This form is still legal, but there is no good reason to use it
(unless you're stuck with a *very* old compiler, but that's not
likely).  The modern and more correct declaration, copy-and-pasted
from the C Standard, is:

    char *ctime(const time_t *timer);

The name of the parameter is not particularly relevant, but "timer" is
what's used in the standard.  The name "Clock" is poorly chosen, since
there's a clock() function with a quite different meaning.

That web page is part of a technical reference for AIX, a flavor of UNIX
from IBM.  It seems to be fairly old.  Unless you're using an old
version of AIX for some reason, I strongly suggest you find a better
reference.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Could you explain what meanings are in this time help contents? fl <rxjwg98@gmail.com> - 2017-01-29 11:04 -0800
  Re: Could you explain what meanings are in this time help contents? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-29 19:20 +0000
  Re: Could you explain what meanings are in this time help contents? Keith Thompson <kst-u@mib.org> - 2017-01-29 13:26 -0800

csiph-web