C++ Library Reference HomeContentsPreviousNextIndex


Preface

The C++ Library Reference describes the C++ libraries, including:

Multiplatform Release

This Sun WorkShop release supports versions 2.6, 7, and 8 of the SolarisTM SPARCTM Platform Edition and Solaris Intel Platform Edition Operating Environments.


Note – In this document, the term "IA" refers to the Intel 32-bit processor architecture, which includes the Pentium, Pentium Pro, and Pentium II, Pentium II Xeon, Celeron, Pentium III, and Pentium III Xeon processors and compatible microprocessor chips made by AMD and Cyrix.

Access to Sun WorkShop Development Tools

Because Sun WorkShop product components and man pages do not install into the standard /usr/bin/ and /usr/share/man directories, you must change your PATH and MANPATH environment variables to enable access to Sun WorkShop compilers and tools.

To determine if you need to set your PATH environment variable:

1. Display the current value of the PATH variable by typing:

% echo $PATH

2. Review the output for a string of paths containing /opt/SUNWspro/bin/.

If you find the paths, your PATH variable is already set to access Sun WorkShop development tools. If you do not find the paths, set your PATH environment variable by following the instructions in this section.

To determine if you need to set your MANPATH environment variable:

1. Request the workshop man page by typing:

% man workshop

2. Review the output, if any.

If the workshop(1) man page cannot be found or if the man page displayed is not for the current version of the software installed, follow the instructions in this section for setting your MANPATH environment variable.


Note – The information in this section assumes that your Sun WorkShop 6 products were installed in the /opt directory. If your Sun WorkShop software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.

The PATH and MANPATH variables should be set in your home .cshrc file if you are using the C shell or in your home .profile file if you are using the Bourne or Korn shells:

For more information about the PATH variable, see the csh(1), sh(1), and ksh(1) man pages. For more information about the MANPATH variable, see the man(1) man page. For more information about setting your PATH and MANPATH variables to access this release, see the Sun WorkShop 6 Installation Guide or your system administrator.

How This Book Is Organized

This book contains the following chapters:

Chapter 1, "Introduction to C++ Libraries," gives an overview of the C++ libraries.

Chapter 2, "The Complex Arithmetic Library," explains the arithmetic operators and mathematical functions in the library.

Chapter 3, "The Classic iostream Library," discusses the classic implementation of of the input and output facility used in C++.

Chapter 4, "Using Classic iostreams in a Multithreading Environment," details how to use the classic iostream library for input and output in a multithreaded environment.

Chapter 5, "The C++ Standard Library," gives a brief overview of the standard library.

Typographic Conventions

TABLE P-1 shows the typographic conventions that are used in Sun WorkShop documentation.

TABLE P-1   Typographic Conventions 
Typeface Meaning Examples
AaBbCc123 The names of commands, files, and directories; on-screen computer output Edit your .login file. Use ls -a to list all files. % You have mail.
AaBbCc123 What you type, when contrasted with on-screen computer output % su Password:
AaBbCc123 Book titles, new words or terms, words to be emphasized Read Chapter 6 in the User's Guide. These are called class options. You must be superuser to do this.
AaBbCc123 Command-line placeholder text; replace with a real name or value To delete a file, type rm filename.
[ ] Square brackets contain arguments that are optional -compat[=n]
( ) Parentheses contain a set of choices for a required option -d(y|n)
| The "pipe" or "bar" symbol separates arguments, only one of which may be used at one time -d(y|n)
... The ellipsis indicates omission in a series -features=a1[,...an]
% The percent sign indicates the word has a special meaning -ftrap=%all,no%division


Shell Prompts

TABLE P-2 shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.

TABLE P-2   Shell Prompts
Shell Prompt
C shell %
Bourne shell and Korn shell $
C shell, Bourne shell, and Korn shell superuser #


Related Documentation

You can access documentation related to the subject matter of this book in the following ways:

Document Collections

TABLE P-3 lists related Sun WorkShop 6 manuals by document collection.

TABLE P-3   Related Sun WorkShop 6 Documentation by Document Collection 
Document Collection Document Title Description
ForteTM Developer 6 / Sun WorkShop 6 Release Documents About Sun WorkShop 6 Documentation Describes the documentation available with this Sun WorkShop release and how to access it.

What's New in Sun WorkShop 6 Provides information about the new features in the current and previous release of Sun WorkShop.

Sun WorkShop 6 Release Notes Contains installation details and other information that was not available until immediately before the final release of Sun WorkShop 6. This document complements the information that is available in the component readme files.
Forte Developer 6 / Sun WorkShop 6 Analyzing Program Performance With Sun WorkShop 6 Explains how to use the new Sampling Collector and Sampling Analyzer (with examples and a discussion of advanced profiling topics) and includes information about the command-line analysis tool er_print, the LoopTool and LoopReport utilities, and UNIX profiling tools prof, gprof, and tcov.

Debugging a Program With dbx Provides information on using dbx commands to debug a program with references to how the same debugging operations can be performed using the Sun WorkShop Debugging window.

Introduction to Sun WorkShop Acquaints you with the basic program development features of the Sun WorkShop integrated programming environment.
ForteTM C 6 / Sun WorkShop 6 Compilers C C User's Guide Describes the C compiler options, Sun-specific capabilities such as pragmas, the lint tool, parallelization, migration to a 64-bit operating system, and ANSI/ISO-compliant C.
ForteTM C++ 6 / Sun WorkShop 6 Compilers C++ C++ Library Reference Describes the C++ libraries, including C++ Standard Library, Tools.h++ class library, Sun WorkShop Memory Monitor, Iostream, and Complex.

C++ Migration Guide Provides guidance on migrating code to this version of the Sun WorkShop C++ compiler.

C++ Programming Guide Explains how to use the new features to write more efficient programs and covers templates, exception handling, runtime type identification, cast operations, performance, and multithreaded programs.

C++ User's Guide Provides information on command-line options and how to use the compiler.

Sun WorkShop Memory Monitor User's Manual Describes how the Sun WorkShop Memory Monitor solves the problems of memory management in C and C++. This manual is only available through your installed product (see /opt/SUNWspro/docs/index.html) and not at the docs.sun.com Web site.
ForteTM for High Performance Computing 6 / Sun WorkShop 6 Compilers Fortran 77/95 Fortran Library Reference Provides details about the library routines supplied with the Fortran compiler.

Fortran Programming Guide Discusses issues relating to input/output, libraries, program analysis, debugging, and performance.

Fortran User's Guide Provides information on command-line options and how to use the compilers.

FORTRAN 77 Language Reference Provides a complete language reference.

Interval Arithmetic Programming Reference Describes the intrinsic INTERVAL data type supported by the Fortran 95 compiler.
ForteTM TeamWare 6 / Sun WorkShop TeamWare 6 Sun WorkShop TeamWare 6 User's Guide Describes how to use the Sun WorkShop TeamWare code management tools.
Forte Developer 6/ Sun WorkShop Visual 6 Sun WorkShop Visual User's Guide Describes how to use Visual to create C++ and JavaTM graphical user interfaces.
ForteTM / Sun Performance Library 6 Sun Performance Library Reference Discusses the optimized library of subroutines and functions used to perform computational linear algebra and fast Fourier transforms.

Sun Performance Library User's Guide Describes how to use the Sun-specific features of the Sun Performance Library, which is a collection of subroutines and functions used to solve linear algebra problems.
Numerical Computation Guide Numerical Computation Guide Describes issues regarding the numerical accuracy of floating-point computations.
Standard Library 2 Standard C++ Class Library Reference Provides details on the Standard C++ Library.

Standard C++ Library User's Guide Describes how to use the Standard C++ Library.
Tools.h++ 7 Tools.h++ Class Library Reference Provides details on the Tools.h++ class library.

Tools.h++ User's Guide
Discusses use of the C++ classes for enhancing the efficiency of your programs.


TABLE P-4 describes related Solaris documentation available through the docs.sun.com Web site.

TABLE P-4   Related Solaris Documentation
Document Collection Document Title Description
Solaris Software Developer Linker and Libraries Guide Describes the operations of the Solaris link-editor and runtime linker and the objects on which they operate.

Programming Utilities Guide Provides information for developers about the special built-in programming tools that are available in the Solaris operating environment.


Man Pages

The C++ Library Reference lists the man pages that are available for the C++ libraries. TABLE P-5 lists other man pages that are related to C++.

TABLE P-5   Man Pages Related to C++  
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 assembler inline procedure calls
lex Generates lexical analysis programs
rpcgen Generates C/C++ code to implement an RPC protocol
sigfpe Allows signal handling for specific SIGFPE codes
stdarg Handles variable argument list
varargs Handles variable argument list
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:

To view the text version of the C++ compiler README file, type the following at a command prompt:

example% CC -xhelp=readme

To access the HTML version of the README, in your Netscape Communicator 4.0 or compatible version browser, open the following file:

/opt/SUNWspro/docs/index.html

(If your Sun WorkShop software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.) Your browser displays an index of Sun WorkShop 6 HTML documents. To open the README, find its entry in the index, then click the title.

Commercially Available Books

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

The C++ Standard Library, Nicolai Josuttis (Addison-Wesley, 1999).

Generic Programming and the STL, Matthew Austern, (Addison-Wesley, 1999).

Standard C++ IOStreams and Locales, Angelika Langer and Klaus Kreft (Addison-Wesley, 2000).

Thinking in C++, Volume 1, Second Edition, Bruce Eckel (Prentice Hall, 2000).

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).

C++ Primer, Third Edition, Stanley B. Lippman and Josee Lajoie (Addison-Wesley, 1998).

Effective C++--50 Ways to Improve Your Programs and Designs, Second Edition, Scott Meyers (Addison-Wesley, 1998).

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


Sun Microsystems, Inc.
Copyright information. All rights reserved.
Feedback
Library   |   Contents   |   Previous   |   Next   |   Index