c++ documentation

J

Jason

hi,

I wish to learn c++ from knowing c. i have documentation relating to c
library functions but what is the c++ equivalent and where can i find it?

Also, is there any restriction in using the libraries i am used to using in
c programs in c++ programs?

Thanks in advance.
 
I

Ivan Vecerina

| I wish to learn c++ from knowing c. i have documentation relating to c
| library functions but what is the c++ equivalent and where can i find it?
Some possible free documentation sources:
A free but out-of-date C++ standard defining all the libraries
can be found at: ftp://ftp.research.att.com/dist/c++std/WP/CD2/

The documentation of the library that comes with GNU C++
is available at:
http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html

SGI STL: http://www.sgi.com/tech/stl/
Has an introduction, and docs for the algorithms and container library,
but nothing about the iostreams library.
Watch out for non-standard extensions that are included in
the documentation (e.g. all the hash_* containers are non-standard).

The online documentation of a commercially available library
can be found at http://www.dinkumware.com/refxcpp.html

For more general resources and books, see also my recent post:
http://groups.google.com/[email protected]

| Also, is there any restriction in using the libraries i am used to using
in
| c programs in c++ programs?

No. But there are two key differences you need to take into
account to write standard-compliant C++ code:

1) #include <c*****> instead of <*****.h>
#include <cstdlib> // not #include <stdlib.h>
The C-header include will work on many platforms,
but is not portable.

2) All C library names (except a few macros) are in
the std C++ namespace. So you should write:
std::puts("hello"); //NOT: puts("hello");
Initially, you can remedy to this by adding a
single directive in your programs:
using namespace std; //rarely a good idea in real code


I hope this helps,
Ivan
 
J

Jon Bell

I wish to learn c++ from knowing c. i have documentation relating to c
library functions but what is the c++ equivalent and where can i find it?

If you can afford to buy books, the standard references are:

Bjarne Stroustrup, "The C++ Programming Language". Get either the third
edition (paperbound) or the "special edition" (hardbound).

Nicolai Josuttis, "The C++ Standard Library".

If you can afford only one, get Stroustrup.
 
D

Derek Baker

Jon Bell said:
If you can afford to buy books, the standard references are:

Bjarne Stroustrup, "The C++ Programming Language". Get either the third
edition (paperbound) or the "special edition" (hardbound).

Nicolai Josuttis, "The C++ Standard Library".

If you can afford only one, get Stroustrup.

I have both of those books, and agree with Jon.

If you buy online, see amazon.co.uk (I'm assuming you're in the uk from your
email), they have both of those books at 50%. That's where I got mine.
 
M

Mike Wahler

Grumble said:
Does gcc come with man pages documenting the C++ libraries? Can one
type man 3 iostream as one would type man 3 stdio?

How hard could it be to actually visit gnu.org and do
a bit of reading to find out?

-Mike
 

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

No members online now.

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,382
Latest member
MichaleStr

Latest Threads

Top