Chapter Contents |
Previous |
Next |
Introduction to the SAS/C C++ Development System |
This release of the SAS/C C++ Development System implements the C++ language by means of a translator that translates C++ to C. The translated C code must be compiled with the SAS/C Compiler, resulting in an object module. The complete translation/compilation process for a C++ source program is shown in Translation Process .
By default, when you invoke the translator both the translation and compilation are performed; that is, you do not have to call the SAS/C Compiler as a separate step. Also by default, the C source is not saved, but is instead a temporary file and is discarded after compilation. You can control the translation and compilation of your program by specifying options when you invoke the translator. These options are described in Option Descriptions.
SAS/C C++ Development System Components |
As shown in SAS/C C++ Development System Components , the SAS/C C++ Development System consists of three parts: a preprocessor, the translator, and a set of standard libraries.
SAS/C C++ Development System Components
Preprocessor |
As part of the translation process, your C++ code is preprocessed. Expanded Translation Process builds on Translation Process , showing the two separate phases the translator goes through before producing C source.
After the preprocessor step is completed, the translator
translates your C++ code into C code. (If you want to stop after the preprocessing
step and skip the translation or compilation steps, specify the
pponly
option, which is described in Option Descriptions .)
// This comment is too long to fit on one // line, so it is continued on the second line. int i; // declaration of an integer
Here are the equivalent C style comments:
/* This comment is too long to fit on one line, so it is continued on the second line.*/ int i; /* declaration of an integer */
x=y; /* One assignment */ a=b; // and another.
However, imbedding comments like this does not produce readable code and is not recommended.
Translator |
After your C++ code has been preprocessed, it is translated into C code. You can control the translation with a variety of options, which are discussed in Option Descriptions .
Standard Libraries |
This release of the SAS/C C++ Development System includes two standard libraries: the streams library and the complex library. Future releases of the product may include other libraries. The C++ I/O and the C++ Complex Library discuss the details of the functions and classes included in the streams and complex libraries.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.