How people look up C++

E

Eurig Jones

As i've just started C++ and being quite experienced with a similar OOP
language such as Java, i'm used to Java's online class library reference
which is basicaly my bible when I'm coding whether its Java's standard
routines or extras such as Java 3D. I was wondering if there was anything
similar available, if not, how do you look up something? whats the best book
to get as a look up book for the standard libraries?
 
K

Kevin Goodsell

Eurig said:
As i've just started C++ and being quite experienced with a similar OOP
language such as Java, i'm used to Java's online class library reference
which is basicaly my bible when I'm coding whether its Java's standard
routines or extras such as Java 3D. I was wondering if there was anything
similar available, if not, how do you look up something? whats the best book
to get as a look up book for the standard libraries?

For the standard library one of the best books available is "The C++
Standard Library: A Tutorial and Reference" by Nicolai Josuttis. This is
*only* a library reference though - it contains little about the
language itself. It also doesn't cover the C library that was inherited
by C++, so that can be a bit of a problem. I usually pull out K&R2 ("The
C Programming Language" 2nd edition, Kernighan & Ritchie) to look up C
functions - but even this is missing some (those that were added with
Normative Addendum 1 in 1995, dealing mostly with wide and multi-byte
characters and strings).

Alternatively, you could get a copy of the C++ standard. Last I heard
you could buy and download an electronic copy from the ANSI store for
$18US. Drafts are also available for free on the C++ committee's web
page. The November 1997 draft (the latest one that's available, as far
as I have been able to determine) can be found in html format here:

http://std.dkuug.dk/jtc1/sc22/wg21/docs/wp/html/nov97-2/

Finally, Dinkumware (http://www.dinkumware.com/) has online references
for C and C++. You'll get an occasional nag screen while browsing, and
there's a strict license that prevents you from saving the pages for
later use. You can also purchase a copy of their reference.

-Kevin
 
J

Jonathan Turkanis

Kevin Goodsell said:
For the standard library one of the best books available is "The C++
Standard Library: A Tutorial and Reference" by Nicolai Josuttis. This is
*only* a library reference though - it contains little about the
language itself. It also doesn't cover the C library that was inherited
by C++, so that can be a bit of a problem. I usually pull out K&R2 ("The
C Programming Language" 2nd edition, Kernighan & Ritchie) to look up C
functions - but even this is missing some (those that were added with
Normative Addendum 1 in 1995, dealing mostly with wide and multi-byte
characters and strings).

Alternatively, you could get a copy of the C++ standard. Last I heard
you could buy and download an electronic copy from the ANSI store for
$18US. Drafts are also available for free on the C++ committee's web
page. The November 1997 draft (the latest one that's available, as far
as I have been able to determine) can be found in html format here:

http://std.dkuug.dk/jtc1/sc22/wg21/docs/wp/html/nov97-2/

Finally, Dinkumware (http://www.dinkumware.com/) has online references
for C and C++. You'll get an occasional nag screen while browsing, and
there's a strict license that prevents you from saving the pages for
later use. You can also purchase a copy of their reference.

This is all correct. I just want to add that if you've just started le
arning C++, you definitely do not want to use the standard as your
reference, as it is written in very technical language and has more
detail than the beginner needs.

But it is good to get a copy of the standard. At this late date, I
would not recommend the draft standard. As of several weeks ago, the
version of the standard available at the ANSI store had some
formatting problems (no table of contents, no hyperlinks); a correct
version is available at

http://www.techstreet.com/cgi-bin/detail?product_id=1143945

Jonathan
 
C

Corno

Eurig Jones said:
As i've just started C++ and being quite experienced with a similar OOP
language such as Java, i'm used to Java's online class library reference
which is basicaly my bible when I'm coding whether its Java's standard
routines or extras such as Java 3D. I was wondering if there was anything
similar available, if not, how do you look up something? whats the best book
to get as a look up book for the standard libraries?
As I came from Java myself, I understand your question completely.
What I found out is that this is one of the fundamental differences between
java and C++; Where java has an big collection of libraries in the standard,
it's very useful to have the class library reference online.
C++ in essence only has the (very powerfull) standard template library (STL)
in the standard. For this, the URL you are looking for is
http://www.sgi.com/tech/stl/

However, you will likely need a lot of non standard (proprietary) libs.
Consequently, the documentation of these libraries vary. For example, if
you're going to program on windows using either the win32 api or MFC, you
will find the information quite well documented in the MSDN library,
etcetera.

The links given to you in the other messages are not the equivalents of the
class library reference of java for looking up functions but are useful
tools for more insight in the language and the STL.

HTH,

Corno
 
K

Kevin Goodsell

Corno said:
C++ in essence only has the (very powerfull) standard template library (STL)
in the standard. For this, the URL you are looking for is
http://www.sgi.com/tech/stl/

I'm not sure if this is *the* STL or not, but you should be aware that
"STL" is technically the name of a library which part of the C++
standard library was based on. So there are some differences between STL
and the C++ standard library. Even though the 'S' stands for "standard",
the STL library is not part of the standard (though something similar is).

People tend to use the term "STL" for the C++ standard library, but it's
less ambiguous to just call it "the C++ standard library".

My concern is that the link above might not describe the C++ standard
library, but something similar, making it misleading. I don't know for
sure whether this is the case or not.

-Kevin
 
J

Jonathan Turkanis

Kevin Goodsell said:
I'm not sure if this is *the* STL or not, but you should be aware that
"STL" is technically the name of a library which part of the C++
standard library was based on. So there are some differences between STL
and the C++ standard library. Even though the 'S' stands for "standard",
the STL library is not part of the standard (though something
similar is).

To clarify a bit ...

SGI STL contains some templates and concepts which are not part of the
standard, such as hash containers, ropes, trivial iterators, ... .

Some people draw a distinction between STL and the version of the
original STL which was incorporated into the standard. A more
important distinction is between that part of the STL which is now
standard (let's call it 'STL') and the standard library as a whole.
The standard library contains elements, notably standard C headers and
the IOStreams library, which are not part of the STL under any
definition.

Jonathan
 
M

MPBroida

Kevin said:
For the standard library one of the best books available is "The C++
Standard Library: A Tutorial and Reference" by Nicolai Josuttis. This is
*only* a library reference though - it contains little about the
language itself. It also doesn't cover the C library that was inherited
by C++, so that can be a bit of a problem. I usually pull out K&R2 ("The
C Programming Language" 2nd edition, Kernighan & Ritchie) to look up C
functions - but even this is missing some (those that were added with
Normative Addendum 1 in 1995, dealing mostly with wide and multi-byte
characters and strings).

A very good book on the C Standard Library is:
The Standard C Library
by P.J. Plauger

My copy is from 1992, but it's still a very good book.
It gives you enough info that you could implement all
of the library functions yourself.

Mike
 
J

Jonathan Turkanis

MPBroida said:
Kevin Goodsell wrote:
A very good book on the C Standard Library is:
The Standard C Library
by P.J. Plauger

My copy is from 1992, but it's still a very good book.
It gives you enough info that you could implement all
of the library functions yourself.

I use this one too.

BTW, I would steer clear of "The C++ Standard Template Library", by
Plauger, Stepanov, Lee and Musser -- despite its list of distinguished
authors. Josuttis is much better.

Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top