Where are the man pages for c++ headers imported from C (e.g. cmath)?

Nils Kassube kassube at gmx.net
Wed Sep 7 05:59:30 UTC 2011

Peng Yu wrote:
> On Tue, Sep 6, 2011 at 12:00 AM, Nils Kassube <kassube at gmx.net> wrote:
> > Peng Yu wrote:
> >> Are there man pages for header files like cmath and cstdio
> >> available on ubuntu? I'm getting tied of always going online.
> > 
> > Install the package "manpages-dev".
> I see something like. This is for math.h. Although cmath is almost
> the same as math.h, I think that there might be subtle difference.

Good point. According to the description I expected to find the C++ 
functions included in the manpages-dev package. However I'm not familiar 
with C++ and therefore I don't know particular C++ functions. After 
searching a bit in synaptic I found some additional man pages in the 
"libstdc++6-4.4-doc" package (the "4.4" part may be different for you if 
you don't run Lucid but another Ubuntu version).

> Is there a manpage for cmath?

No, even apt-file doesn't know about one. Maybe there are only 
differences between cmath and math.h in some implementation details 
which are not important for the programmer? In 
/usr/include/c++/4.4/cmath I found this comment:

| /** @file include/cmath
|  *  This is a Standard C++ Library file.  You should @c #include this
|  file
|  *  in your programs, rather than any of the "*.h" implementation
|  files.
|  *
|  *  This is the C++ version of the Standard C Library header @c
|  math.h,
|  *  and its contents are (mostly) the same as that header, but are all
|  *  contained in the namespace @c std (except for names which are
|  defined
|  *  as macros in C).
|  */

Anyway, with the "libstdc++6-4.4-doc" package you get some additional 
documentation about the library functions at 
<file:///usr/share/doc/gcc-4.4-base/libstdc++/html/index.html> (again 
replace the "4.4" part if you don't run Lucid). And if you want similar 
documentation for the C library, it is in the package "glibc-doc".


More information about the ubuntu-users mailing list