Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #102730
| 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 | 2017-01-29 13:26 -0800 |
| Organization | None to speak of |
| Message-ID | <lna8a9blsg.fsf@kst-u.example.com> (permalink) |
| References | <58fe223e-7877-4fab-a883-cbaf3ae7d809@googlegroups.com> |
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
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