Previous Next Contents Index Doc Set Home


Preface


This manual, C++ User's Guide, explains how to use the C++ compiler and some of the newer C++ language features. This manual complements the C++ documentation set described in the "C++ Documentation" section, below.


Audience

The audience for this book includes software developers writing programs in the C++ language who are familiar with compiled program development and C++ language basics. This book is not a basic text in C++ programming.


Organization of This Book

This book contains the following chapters:

The book also contains these appendixes:


C++ Documentation

Although there is no prerequisite reading for this guide, you should have access to C++ reference books such as The C++ Programming Language by Bjarne Stroustrup. You should also have access to the documents described in the following sections.

.

Table  P-1 Summary of C++ Compiler Documentation and Its Location  

Document
On-line Books
HTML
On-line ASCII
On-line PostScript
Hard copy

C++ User's Guide

X

X

 

 

X

C++ Quick Reference

 

 

 

 

X

C++ Library Reference

X

X

 

 

X

Tools.h++ User's Guide

X

X

 

 

X

Tools.h++ Class Library Reference

X

X

 

 

X

man pages

 

 

/opt/SUNWspro
/man

 

 

C++ README File

 

 

/opt/SUNWspro
/READMEs/C++

 

 

Sun WorkShop Installation and Licensing Guide

X

X

 

 

X

Sun WorkShop Quick Install for Solaris

 

X

 

 

X

"What Every Computer Scientist Should Know About Floating-Point Arithmetic" white paper

 

 

 

/opt/SUNWspro
/READMEs
/floating-point.ps

 

Manuals

In addition to the C++ User's Guide, the following books are included in the C++ documentation set.

Commercially Available Books

The following is a partial list of available books on C++.

Object-Oriented Analysis and Design with Applications, Second Edition, Grady Booch (Addison-Wesley, 1994)

Thinking in C++, Bruce Eckel (Prentice Hall, 1995)

The Annotated C++ Reference Manual, Margaret A. Ellis and Bjarne Stroustrup (Addison-Wesley, 1990)

Design Patterns: Elements of Reusable Object-Oriented Software, Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, (Addison-Wesley, 1995)

A C++ Primer, Second Edition, Stanley B. Lippman (Addison-Wesley, 1989)

Effective C++--50 Ways to Improve Your Programs and Designs, Scott Meyers (Addison-Wesley, 1996)

C++ for C Programmers, Ira Pohl (Benjamin/Cummings, 1989)

The C++ Programming Language, Second Edition, Bjarne Stroustrup (Addison-Wesley, 1991)

Online Documentation

Online Books

Certain manuals are provided in online viewing tools that take advantage of dynamically linked headings and cross-references. Online documentation enables you to electronically jump from one subject to another and to search for topics by using a word or phrase.

Online documentation for this product is installed separately. See Sun WorkShop Installation and Licensing Guide for further information on installation.

Man Pages

Each man page concisely explains a single subject, which could be a user command or library function. Man pages are in:

opt install dir/SUNWspro/man

Table P-2 lists and describes the C++ man pages.


Note - Before you use the man command, insert the name of the directory in which you have chosen to install the C++ compiler at the beginning of your search path. Doing this enables you to use the man command. This is usually done in the .cshrc file, in a line with setenv MANPATH at the start; or in the .profile file, in a line with export MANPATH at the start.



Table  P-2 C++ Man Pages  

Title
Description

CC

Displays the C++ compilation system

cartpol

Provides Cartesian/polar functions in the C++ complex number math library

cplx.intro

Introduces the C++ complex number math library

cplxerr

Provides complex error-handling functions in the C++ complex number math library

cplxops

Provides arithmetic operator functions in the C++ complex number math library

cplextrig

Provides trigonometric operator functions in the C++ complex number math library

demangle

Decodes a C++ encoded symbol name

filebuf

Buffer class for file I/O

fstream

Provides stream class for file I/O

generic

Provides generic macro definitions used for creating generic types

istream

Supports formatted and unformatted input

ios

Provides basic iostream formatting

ios.intro

Introduces iostream man pages

manip

Provides iostream manipulators

ostream

Supports formatted and unformatted output

queue

Provides list management for task library

sbufprot

Provides protected interface of streambuffer base class

sbufpub

Provides public interface of streambuffer base class

sigfpe

Allows signal handling for specific SIGFPE codes

ssbuf

Provides buffer class for character arrays

stdarg

Handles variable argument list

stdiobuf

Provides buffer and stream classes for use with C stdio

stream_locker

Provides class used for application level locking of iostream class object

stream_MT

Base class that provides dynamic changing of iostream class object to and from MT safely

strstream

Provides stream class for "I/O" using character arrays

task

Provides coroutines in the C++ task library

task.intro

Introduces coroutine library man pages

tasksim

Provides histogram and random numbers for the task library

varargs

Handles variable argument list

vector

Provides generic vector and stack

Table P-3 lists man pages that contain information related to the C++ compiler.

Table  P-3 C++-Related Man Pages

Title
Description

c++filt

Copies each file name in sequence and writes it in the standard output after decoding symbols that look like C++ demangled names.

dem

Demangles one or more C++ names that you specify

fbe

Creates object files from assembly language source files.

fpversion

Prints information about the system CPU and FPU

gprof

Produces execution profile of a program

ild

Links incrementally, allowing insertion of modified object code into a previously built executable

inline

Expands inline procedure calls

lex

Generates lexical analysis programs

rpcgen

Generates C/C++ code to implement an RPC protocol

version

Displays version identification of object file or binary

yacc

Converts a context-free grammar into a set of tables for a simple automaton that executes an LALR(1) parsing algorithm

README file

The README file highlights important information about the compiler, including:

View the README file by typing
CC -readme.

Other READMEs:

Related information can be found in the READMEs directory, which is located at /opt/SUNWspro/READMEs in a standard installation.

C++ Migration Guide

The C++ Migration Guide helps you migrate your code from cfront-based C++ 3.0 to the current compiler. This manual is displayed when you type CC -migration. (The C++ Migration Guide is also found in Appendix A of this manual.)

Articles

"What Every Computer Scientist Should Know About Floating-Point Arithmetic"

A floating-point white paper by David Goldberg. This paper can be found in the README directory:

opt-install-dir/SUNWspro/READMEs


Conventions in Text

The following table describes the typographic conventions and symbols used in this book.

Table  P-4 Typographic Conventions 

Typeface or Symbol
Meaning
Example

AaBbCc123

The names of commands, files, and directories; on-screen computer output

Edit your .login file.

Use ls -a to list all files.

system% You have mail.

AaBbCc123

What you type, contrasted with on-screen computer output

system% su

Password:

AaBbCc123

Command-line placeholder:

replace with a real name or value

To delete a file, type rm filename.

AaBbCc123

Book titles, new words or terms, or words to be emphasized

Read Chapter 6 in User's Guide. These are called class options.

You must be root to do this.

Code samples are included in boxes and may display the following:

%

C shell prompt

system%

$

Bourne and Korn shell prompt

system$

#

Superuser prompt, all shells

system#

[ ]

Square brackets contain arguments that can be optional or required.

-d[y|n]

|

The "pipe" or "bar" symbol separates arguments, only one of which may be used at one time.

-d[y|n]

,

The comma separates arguments, one or more of which may be used at one time.

-xinline=[f1,...fn]

:

The colon, like the comma, is sometimes used to separate arguments.

-Rdir[:dir]

...

The ellipsis indicates omission in a series.

-xinline=[f1,...fn]

%

The percent sign indicates the word following it has a special meaning.

-ftrap=%all

<>

In ASCII files, such as the README file, angle brackets contain a variable that must be replaced by an appropriate value.

-xtemp=<dir>




Previous Next Contents Index Doc Set Home