HPlogo

HP C++ Programmer's Guide: HP 9000 Series Workstations and Servers

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

HP Part Number: 92501-90029

Edition: Fourth Edition

Published: Printed in U.S.A. June 1996


Table of Contents

Preface
Overview of HP C++
History of C++
Getting Started with HP C++
Using the CC Command
Compiling and Executing a Simple Program
Debugging C++ Programs
Using the Online Sample Programs
How C++ Differs from C
Compatibility with C
Reliability Improvements
Other Extensions to C
Changing Your C Programs to C++
Support for Object-Oriented Programming
What Is Object-Oriented Programming?
Object-Oriented Programming: The Bank Example
How Does C++ Support Object-Oriented Programming?
Encapsulation
Data Abstraction
Inheritance
Type Polymorphism
Inline Functions
The new and delete Operators
Constructors and Destructors
Overloaded Operators
Conversion Operators
Templates
Class Templates
Function Templates
Template Code is Stored in a Repository
CC Options for Templates
Exception Handling
You Must Use the +eh Option
The throw, catch, and try Statements
Examples
The HP C++ Preprocessor
Preprocessing Directives
Overview
Syntax
Using Preprocessor Directives
The #include Directive
Syntax
Description
Examples
The #define Directive
Syntax
Description
Using Macros to Define Constants
Other Macros
Using Constants and Inline Functions instead of Macros
Predefined Macros
Conditional Compilation
Syntax
Description
Examples
Line Control
Syntax
Description
Example
Pragma Directive
Syntax
Description
Example
Error Directive
Syntax
Description
Examples
Trigraph Sequences
Description
Example
Phases of the Compiling System
Phases of the Compiling System
What Happens in Compiler Mode
What Happens in Translator Mode
Compiling with the CC Command
Setting Your Path to the CC Command
Syntax
Specifying Files to the CC Command
Specifying Options to the CC Command
An Example of Using a Compiler Option
HP C++ Compiler Options
Environment Variables: CXXOPTS
Pragmas: OPTIMIZE, OPT_LEVEL
System Library and Header Files
Standard HP-UX Libraries
C++ Run-Time Libraries
C++ Library Header Files
Linking to C++ Libraries
Creating and Using Shared Libraries
Compiling for Shared Libraries
Creating a Shared Library
Using a Shared Library
Example
Linking Archive or Shared Libraries
Updating a Shared Library
Forcing the Export of Symbols in main
Binding Times
Side Effects of C++ Shared Libraries
Routines You Can Use to Manage C++ Shared Libraries
Shared Library Header files
Version Control in Shared Libraries
Distributing HP C++ Libraries, Object Files, and Executable Files
Executing HP C++ Programs
Redirecting stdin and stdout
An Extensive Example
The Library Example
Linking
The Lending Library
Optimizing HP C++ Programs
Inter-Language Communication
Introduction
Data Compatibility between C and C++
Calling HP C from HP C++
Using the extern "C" Linkage Specification
Differences in Argument Passing Conventions
Calling HP C from HP C++: An Example
Calling HP C++ from HP C
Calling HP Pascal and HP FORTRAN from HP C++
The main() Function
Function Naming Conventions
Using Reference Variables to Pass Arguments
Using extern "C" Linkage
Strings
Arrays
Definition of TRUE and FALSE
Files
Linking HP FORTRAN 77 and HP Pascal Routines on HP-UX
HP Specific Features of lex and yacc
Notes on Using lex and yacc
Index
© Hewlett-Packard Development Company, L.P.