Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 1996 17:20:57 +0200 (IST)
From:      Nadav Eiron <nadav@barcode.co.il>
To:        Sean Kelly <kelly@fsl.noaa.gov>
Cc:        Gary Kline <kline@tera.com>, FreeBSD Questions Mailgroup <freebsd-questions@FreeBSD.org>
Subject:   Re: interpretation?
Message-ID:  <Pine.BSF.3.91.961016171607.7138A-100000@gatekeeper.barcode.co.il>
In-Reply-To: <326451D7.41C67EA6@fsl.noaa.gov>

next in thread | previous in thread | raw e-mail | index | archive | help


On Tue, 15 Oct 1996, Sean Kelly wrote:

> Gary Kline wrote:
> 
> > Can any resident C wizard interpret this parameter definition for me?
> > 
> > > localtime(const time_t * const timep)
> 
> You might want a C++ wizard.
> 
> timep is a constant pointer to a constant time_t object.
> 
> > And, is there a simpler way of saying the same thing?  time_t is
> > a long int.  Thanks for any lucid translation....
> 
> So long as locatime() promises to not modify the object pointed to by
> timep, then locatime(time_t* timep) is simpler.
> 

Yeah, but may not work if you'll try passing a const to it. Borland C++ 
for one (haven't had much experience with gcc lately) will not let you 
convert a const <smthg> * const var to a non-const one. This means that 
if you already have a variable declared as
const time_t x 
you won't be able to pass its address to a routine that is declared as
localtime (time_t * timep)

> -- 
> Sean Kelly
> NOAA Forecast Systems Laboratory
> Boulder Colorado USA
> 
Nadav



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.961016171607.7138A-100000>