Navigating C++

B

brundlefly76

As a Perl programmer for many years, this week I decided to stick my
toe back into C for a specific project.

During which I was tinkering with C++, which I have no production
experience in.

I am embarrased to say I am having soem difficulty navigating C++ in
Linux.

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?
 
P

Phlip

brundlefly76 said:
So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

If you know just enough C++ to select distinct keywords, you can use Google
for all the intermediate and advanced stuff.

However, the 'man' for C++ is at your local bookstore.

Perl hides the lowest-level details, such as your memory system. C++
requires you to remain aware what points to what. You cannot write a C++
program based on 'apropos' and 'man'. Crack a book.
Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

Nobody can contribute C++ to a single repository, because C++ has no common
package management system. CPAN depends on absolutely everything using
Makefile.PL properly. C++ has no equivalent, because C++ programs have
greater freedom to abuse your CPU.
For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?

www.google.com and http://groups.google.com

thence www.boost.org , http://sf.net , and thousands of different code
sample and repository sites.
 
T

Tim Love

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.
'man for' isn't useful either.
So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.
I think html pages are more useful. Some may well be on your system.

Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.
How and where do I browse the available library of contributed C++
libs?
http://www.boost.org/ is a good place to start. See also the FAQ
http://www.parashift.com/c++-faq-lite/class-libraries.html
 
M

Maciej Sobczak

Hi,

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

Yes, the C++ documentation does not usually follow what is considered to
be a "Unix tradition". I've never seen man pages for C++ standard library.
Taking into account that "man printf" works fine (OK, "man 3 printf"), I
agree that the lack of "man cout" can be irritating.

Try these pages:

http://www.roguewave.com/support/docs/SourcePro/stdlibref/
http://www.cppreference.com/
http://www.sgi.com/tech/stl/
How and where do I browse the available library of contributed C++
libs?

I've found this index to be quite comprehensive:

http://www.trumphurst.com/cpplibs/cpplibs.phtml
 
P

Peter T. Breuer

In comp.os.linux.misc [email protected] said:
I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

There is no reason it should - that's part of C++.
I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.
Good.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

There is a man page for the compiler. If you want to know how to
program in C++, you have to buy a book (as for any language) or some
other dcumentation.
Second, I realize that there are C++ extensions and OO libraries and so

I don't realise. Libraries will have their man pages.
on. In Perl, I would just visit CPAN for these things.
"just"?!

How and where do I browse the available library of contributed C++
libs?

Libraries, once compiled, are not (particularly) specific to a
programming language. The linker links with their exported symbols, not
to the language they are written in. All you need to know is the
calling convention (;)>. And maybe sme declarations.
For example, I want to parse posix command line options, which in C I
would do with getopt_long.

Then you can do it just fine with getopt_long in C++.
I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go

I presume so too. Google.
to *find* these types of libraries?

"the universe".

Peter
 
M

mjt

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

.... info gcc, info g++
How and where do I browse the available library of contributed C++
libs?
For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?

.... probably best to visit the bookstore for
a reference on this. as you know, too, you
can use C functions using c++
 
B

Ben Hutchings

As a Perl programmer for many years, this week I decided to stick my
toe back into C for a specific project.

During which I was tinkering with C++, which I have no production
experience in.

I am embarrased to say I am having soem difficulty navigating C++ in
Linux.

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

Try 'man Namespace_std' (I happen to know this is the correct manual
page, but I don't know whether you will have it).
I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

The C++ library for g++ has inline documentation in the code which can
be extracted and processed by doxygen into various forms, including
manual pages. Not all Linux distributors necessarily build and
distribute these.

There is a separate documentation page for each function, function
template, class, class template and namespace. Static objects, type
aliases and enumerations are documented on the manual pages of their
containing scopes. Note that the manual page names include
namespace qualification ('std::' prefix for almost everything in
the standard libary).
Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

There is no single site acknowledged as *the* place to find open
source C++ libraries. The Open Directory may be of help:
<http://www.dmoz.org/Computers/Programming/Languages/C++/Class_Libraries/>.
I would tend to look first in Boost, as the Boost libraries are
generally acknowledged to be of a high standard and they work well
with the standard library and are portable.
For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?

Boost.Program_options does this (and more if you want it).
 
D

Dietmar Kuehl

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

C++ has a fairly different culture than Perl. Part of this is that
there is not just one implementation of C++ which results in some
difference. You already stubmbled of the fact that not all C++
implementations come with man pages. I haven't checked recently
but I seem to remember that I have seen info(1) pages shipping for
parts of the C++ library with gcc. Other compilers, e.g. SUN's
actually have man pages. The primary source of information in C++
are books.
Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

Yes, and having just one implementation of Perl makes it viable to
more less automatically access them. For C++ you would probably
visit Boost (<http://www.boost.org/>) for some form of open and
free library but it does not include all C++ libraries. Due to a
rather wide range of different programming styles, it is unclear
whether just one library archive is really viable.
 
L

Llewelly

As a Perl programmer for many years, this week I decided to stick my
toe back into C for a specific project.

During which I was tinkering with C++, which I have no production
experience in.

I am embarrased to say I am having soem difficulty navigating C++ in
Linux.

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

Just get yourself a some good books - say, Langer & Kreft for
iostreams, and Austern for the STL, and a copy of the ISO C++ 2003
standard.

The gnu libstdc++ docs are here:
http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html . THe
most useful part of that is probably:
http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/modules.html

There are man pages for all this in a tarball at
ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/ .
Just untar it whereever you want, add that dir to your man path,
and presto, man pages. Start with 'man C++Intro' . But there's no
man page for cout. IIRC, the philosophy behind the libstdc++ docs
is that the ISO C++ standard should be the documentation, and the
libstdc++ docs should document only what the standard does
not.

And sgi's docs (which g++ users have relied on forever) are here:
http://www.sgi.com/tech/stl/

But I have a hard time seeing how someone unfamiliar with what's in
good C++ texts could make much use of that documentation. You
aren't likely to get anywhere in C++ unless you spend a few
hundred dollars on books, and (much more importantly) a few
hundred hours studying those books, and applying the lessons in
them.
I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

See above. I don't know if any linux distros provide them
pre-packaged.
Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

boost.org is the closest thing c++ has to CPAN. But in all honesty, I
don't think any other language has anything quite as nice as
CPAN. (Nor does any other langauge have man pages as nice as
Perl's or C's.)
For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?

boost.org - specifically, http://boost.org/doc/html/program_options.html
 
I

Ioannis Vranos

As a Perl programmer for many years, this week I decided to stick my
toe back into C for a specific project.

During which I was tinkering with C++, which I have no production
experience in.

I am embarrased to say I am having soem difficulty navigating C++ in
Linux.

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?


You may check this page:

http://www23.brinkster.com/noicys/learningcpp.htm
 
L

Llewelly

There is no reason it should - that's part of C++.

Nonsense. 'fopen' is part of C, and yet, on any unix or linux system
I've used, 'man fopen' results in useful information.

'man' is the traditional documentation format on unix and linux, and
even today it is still preferred by many users. That's plenty of
reason for a C++ implentor to provide a man page for cout.
 
M

Mike Mol

mjt said:
("(e-mail address removed)" <[email protected]>) scribbled:
... probably best to visit the bookstore for
a reference on this. as you know, too, you
can use C functions using c++

I'll throw in a plug here for Herb Shildt's "C++: The Complete
Reference" ... It taught me the language. It reads more like a
reference manual than a textbook, so if you've already got a background
in programming, it's fairly convenient.

ISBN: 0072226803
 
F

Francis Glassborow

Mike said:
I'll throw in a plug here for Herb Shildt's "C++: The Complete
Reference" ... It taught me the language. It reads more like a
reference manual than a textbook, so if you've already got a background
in programming, it's fairly convenient.

Not if you want technically correct information. He is wrong or confused
often enough so that no experienced C++ user would want to trust it.


For library details stick with The Standard C++ Library by Nico
Josuttis. If you want details of the language itself look them up in
'The C++ Programming Language' by Bjarne Stroustrup. No serious C++
programmer should be without those two books.
 
R

Roger Leigh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Llewelly said:
Nonsense. 'fopen' is part of C, and yet, on any unix or linux system
I've used, 'man fopen' results in useful information.

'man' is the traditional documentation format on unix and linux, and
even today it is still preferred by many users. That's plenty of
reason for a C++ implentor to provide a man page for cout.

Since libstdc++ is documented with Doxygen, it could be made to spit
out troff rather than HTML (there's an option to enable it), but the
man pages are rather verbose and, unlike manpages, do not have related
functions/symbols grouped on a single page.


Regards,
Roger

- --
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFCLMSHVcFcaSW/uEgRAuFiAJ4+r8p4NZSN8vdx8EPN8XMyRGAqOQCgml02
XeXp7pdTFxUnuUWg61b84Uk=
=8CLX
-----END PGP SIGNATURE-----
 
J

Jean-David Beyer

As a Perl programmer for many years, this week I decided to stick my
toe back into C for a specific project.

During which I was tinkering with C++, which I have no production
experience in.

I am embarrased to say I am having soem difficulty navigating C++ in
Linux.

I am pretty certain that I installed all the available documentation
with my Suse 9.2 install, yet 'man cout' for example, yields no
results.

I have no problems finding my perl and c man documentation, and the C++
compiler is installed and works fine.

So, my first problem is that I dont know where the man pages live for
C++, or where to get them if Im missing them.

Second, I realize that there are C++ extensions and OO libraries and so
on. In Perl, I would just visit CPAN for these things.

How and where do I browse the available library of contributed C++
libs?

For example, I want to parse posix command line options, which in C I
would do with getopt_long. I assume, however, that someone has already
written a nice OO C++ interface to command line options - where do I go
to *find* these types of libraries?

This has sure gotten to be a long thread. I run Red Hat Enterprise Linux,
and there is a lot of documentation to be obtained, starting at:

/usr/share/doc/rhel-gcc-en-3/index.html

that you can examine with a browser. I do not know where it is in SuSE,
but it might be there somewhere like that. Probably will not say rhel- in
it though.

One reason why functions like close(), open(), read() and write() have
manual pages is that there are kernel entries that support them almost
directly, so a manual page is appropriate.

Things like cout <<, cerr <<, etc., do not exist is that there are no
kernel entries for them; they are internal to the implimentation of C++
(and are almost certainly implimented by run-time library routines that
call close(), open(), etc.), so you will not find manual pages for them
any more than you would find manual pages for the DO and FORMAT statements
of a FORTRAN compiler.

In C++ you can access the IO routines like read(), write(), etc., if you
want to, but it is usually a mistake. I do find things like sprintf()
helpful, though.

I found the best documentation I use for C++ are in a few textbooks. To
begin, I like "C++ Primer" by Lippman and Lajoie (I have the Third
Edition) for most everything, and "The C++ Standard Library" by Josuttis.
Bjarne Stroustrup's book, "The C++ Programming Language" is good if you
need it, and Peggy Ellis and Bjarne Stroustrup's book, "The Annotated C++
Reference Manual" can be helpful. But I would not start with the last two.
 

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
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top