Mail Archives: djgpp/1998/12/30/10:20:50
Michael Lehotay wrote:
> Martin Ambuhl wrote:
> >
> > Michael Lehotay wrote:
> > >
> > > I've started to teach myself C++ from Stroustrup (3rd ed.), and I've run
> > > into a problem: there is no <limits> header file. I realize I could use
> > > <limits.h> instead, but what I really wanted was numeric_limits.
> >
> > When there is a C header named <x.h>, the corresponding C++ header is
> > called <cx>. In this case, it is <climits>.
> >
> > An unfortunate problem with BS's 3rd ed is a large number of errata,
> > which are listing in several files at the wed site you can reach through
> > the URL on the back cover of your book.
He is correct. The file limits (which normally would be a shell that #includes
limits.h, and would be found in the lang/cxx directory) is not there. A review
of the errata shows that this has never changed, so I think we're safe in
assuming that it's not there.
The way in which <limits> is used in the example he's talking about indicates
that it's a c++ file and not a c file.
I recommend this proceedure:
1. Ignore the example until you understand how to create fred::mary() methods.
2. When you learn that, go back and create a <limits> file which has the
functionality expected by Stroustrup.
I suppose you could search for someone else's <limits> file, but you'd have to
redefine everything, so you're probably better off just waiting.
The limits.h file in the include directory is the c limits file, which has the
correct constants, but not implemented as inline function returns.
This is one of those, "as soon as I get a minute I'll whip one up and post it"
things that I never seem to have time to do.
Charles
--
Charles Krug, Jr.
Application Engineer
Pentek Corp
1 Park Way
Upper Saddle River, NJ 07458
- Raw text -