Contents

About ILE C/C++ Language Reference (SC09-7852-01)
Who should read this book
Highlighting Conventions
How to Read the Syntax Diagrams
Prerequisite and related information
How to send your comments
What's new for IBM i 7.1
Scope and linkage
Scope
Block/local scope
Function scope
Function prototype scope
File/global scope
Examples of scope in C
Class scope (C++ only)
Namespaces of identifiers
Name hiding (C++ only)
Program linkage
Internal linkage
External linkage
No linkage
Language linkage
Name mangling (C++ only)
Lexical elements
Tokens
Keywords
Keywords for language extensions
Identifiers
Characters in identifiers
Reserved identifiers
The __func__ predefined identifier
Literals
Integer literals
Decimal integer literals
Hexadecimal integer literals
Octal integer literals
Boolean literals
Floating-point literals
Binary floating-point literals
Hexadecimal floating-point literals
Decimal floating-point literals
Packed Decimal Literals
Character literals
String literals
String concatenation
Punctuators and operators
Alternative tokens
Source program character set
Multibyte characters
Escape sequences
The Unicode standard
Digraph characters
Trigraph sequences
Comments
Data objects and declarations
Overview of data objects and declarations
Overview of data objects
Incomplete types
Compatible and composite types
Overview of data declarations and definitions
Tentative definitions
Storage class specifiers
The auto storage class specifier
Storage duration of automatic variables
Linkage of automatic variables
The static storage class specifier
Linkage of static variables
The extern storage class specifier
Storage duration of external variables
Linkage of external variables
The mutable storage class specifier (C++ only)
The register storage class specifier
Storage duration of register variables
Linkage of register variables
The __thread storage class specifier
Type specifiers
Integral types
Boolean types
Floating-point types
Real floating-point types
Character types
The void type
Compatibility of arithmetic types (C only)
User-defined types
Structures and unions
Structure and union type definition
Member declarations
Flexible array members
Zero-extent array members
Bit field members
Structure and union variable declarations
Structure and union type and variable definitions in a single statement
Access to structure and union members
Anonymous unions
Enumerations
Enumeration type definition
Enumeration members
Enumeration variable declarations
Enumeration type and variable definitions in a single statement
Compatibility of structures, unions, and enumerations (C only)
Compatibility across separate source files
typedef definitions
Examples of typedef definitions
Type qualifiers
The __align type qualifier
Examples using the __align qualifier
The const type qualifier
The restrict type qualifier
The volatile type qualifier
Type attributes
The aligned type attribute
The packed type attribute
The transparent_union type attribute (C only)
Declarators
Overview of declarators
Examples of declarators
Type names
Pointers
Pointer arithmetic
Type-based aliasing
Compatibility of pointers (C only)
Arrays
Variable length arrays (C++ only)
Compatibility of arrays
References (C++ only)
Initializers
Initialization and storage classes
Initialization of automatic variables
Initialization of static variables
Initialization of external variables
Initialization of register variables
Initialization of structures and unions
Initialization of enumerations
Initialization of pointers
Initialization of arrays
Initialization of character arrays
Initialization of multidimensional arrays
Initialization of references (C++ only)
Direct binding
Variable attributes
The aligned variable attribute
The packed variable attribute
The mode variable attribute
The weak variable attribute
Type conversions
Arithmetic conversions and promotions
Integral conversions
Boolean conversions
Floating-point conversions
Integral and floating-point promotions
Lvalue-to-rvalue conversions
Pointer conversions
Conversion to void*
Reference conversions (C++ only)
Qualification conversions (C++ only)
Function argument conversions
Expressions and Operators
Lvalues and rvalues
Primary expressions
Names
Literals
Integer constant expressions
Identifier expressions (C++ only)
Parenthesized expressions ( )
Scope resolution operator :: (C++ only)
Function call expressions
Member expressions
Dot operator .
Arrow operator ->
Unary expressions
Increment operator ++
Decrement operator --
Unary plus operator +
Unary minus operator -
Logical negation operator !
Bitwise negation operator ~
Address operator &
Indirection operator *
The typeid operator (C++ only)
The __alignof__ operator
The sizeof operator
The __typeof__ operator
Binary expressions
Assignment operators
Simple assignment operator =
Compound assignment operators
Multiplication operator *
Division operator /
Remainder operator %
Addition operator +
Subtraction operator -
Bitwise left and right shift operators << >>
Relational operators < > <= >=
Equality and inequality operators == !=
Bitwise AND operator &
Bitwise exclusive OR operator ^
Bitwise inclusive OR operator |
Logical AND operator &&
Logical OR operator ||
Array subscripting operator [ ]
Comma operator ,
Pointer to member operators .* ->* (C++ only)
Conditional expressions
Types in conditional C expressions
Types in conditional C++ expressions
Examples of conditional expressions
Cast expressions
Cast operator ()
The static_cast operator (C++ only)
The reinterpret_cast operator (C++ only)
The const_cast operator (C++ only)
The dynamic_cast operator (C++ only)
Compound literal expressions
new expressions (C++ only)
Placement syntax
Initialization of objects created with the new operator
Handling new allocation failure
delete expressions (C++ only)
throw expressions (C++ only)
Operator precedence and associativity
Statements
Labeled statements
Expression statements
Resolution of ambiguous statements (C++ only)
Block statements
Example of blocks
Selection statements
The if statement
Examples of if statements
The switch statement
Restrictions on switch statements
Examples of switch statements
Iteration statements
The while statement
The do statement
The for statement
Examples of for statements
Jump statements
The break statement
The continue statement
Examples of continue statements
The return statement
Examples of return statements
The goto statement
Null statement
Functions
Function declarations and definitions
Function declarations
Function definitions
Examples of function declarations
Examples of function definitions
Compatible functions (C only)
Multiple function declarations (C++ only)
Function storage class specifiers
The static storage class specifier
The extern storage class specifier
Function specifiers
The inline function specifier
Linkage of inline functions
Function return type specifiers
Function return values
Function declarators
Parameter declarations
Parameter types
Parameter names
Static array indices in function parameter declarations (C only)
Function attributes
The const function attribute
The noinline function attribute
The pure function attribute
The weak function attribute
The main() function
Function calls
Pass by value
Pass by reference
Allocation and deallocation functions (C++ only)
Default arguments in C++ functions (C++ only)
Restrictions on default arguments
Evaluation of default arguments
Pointers to functions
Namespaces (C++ only)
Defining namespaces (C++ only)
Declaring namespaces (C++ only)
Creating a namespace alias (C++ only)
Creating an alias for a nested namespace (C++ only)
Extending namespaces (C++ only)
Namespaces and overloading (C++ only)
Unnamed namespaces (C++ only)
Namespace member definitions (C++ only)
Namespaces and friends (C++ only)
The using directive (C++ only)
The using declaration and namespaces (C++ only)
Explicit access (C++ only)
Overloading (C++ only)
Overloading functions (C++ only)
Restrictions on overloaded functions (C++ only)
Overloading operators (C++ only)
Overloading unary operators (C++ only)
Overloading increment and decrement operators (C++ only)
Overloading binary operators (C++ only)
Overloading assignments (C++ only)
Overloading function calls (C++ only)
Overloading subscripting (C++ only)
Overloading class member access (C++ only)
Overload resolution (C++ only)
Implicit conversion sequences (C++ only)
Standard conversion sequences
User-defined conversion sequences
Ellipsis conversion sequences
Resolving addresses of overloaded functions (C++ only)
Classes (C++ only)
Declaring class types (C++ only)
Using class objects (C++ only)
Classes and structures (C++ only)
Scope of class names (C++ only)
Incomplete class declarations (C++ only)
Nested classes (C++ only)
Local classes (C++ only)
Local type names (C++ only)
Class members and friends (C++ only)
Class member lists (C++ only)
Data members (C++ only)
Member functions (C++ only)
Inline member functions (C++ only)
Constant and volatile member functions (C++ only)
Virtual member functions (C++ only)
Special member functions (C++ only)
Member scope (C++ only)
Pointers to members (C++ only)
The this pointer (C++ only)
Static members (C++ only)
Using the class access operators with static members (C++ only)
Static data members (C++ only)
Static member functions (C++ only)
Member access (C++ only)
Friends (C++ only)
Friend scope (C++ only)
Friend access (C++ only)
Inheritance (C++ only)
Derivation (C++ only)
Inherited member access (C++ only)
Protected members (C++ only)
Access control of base class members (C++ only)
The using declaration and class members (C++ only)
Overloading member functions from base and derived classes (C++ only)
Changing the access of a class member (C++ only)
Multiple inheritance (C++ only)
Virtual base classes (C++ only)
Multiple access (C++ only)
Ambiguous base classes (C++ only)
Name hiding
Ambiguity and using declarations
Unambiguous class members
Pointer conversions
Overload resolution
Virtual functions (C++ only)
Ambiguous virtual function calls (C++ only)
Virtual function access (C++ only)
Abstract classes (C++ only)
Special member functions (C++ only)
Overview of constructors and destructors (C++ only)
Constructors (C++ only)
Default constructors (C++ only)
Explicit initialization with constructors (C++ only)
Initialization of base classes and members (C++ only)
Construction order of derived class objects (C++ only)
Destructors (C++ only)
Pseudo-destructors (C++ only)
User-defined conversions (C++ only)
Conversion constructors (C++ only)
The explicit specifier (C++ only)
Conversion functions (C++ only)
Copy constructors (C++ only)
Copy assignment operators (C++ only)
Templates (C++ only)
Template parameters (C++ only)
Type template parameters (C++ only)
Non-type template parameters (C++ only)
Template template parameters (C++ only)
Default arguments for template parameters (C++ only)
Template arguments (C++ only)
Template type arguments (C++ only)
Template non-type arguments (C++ only)
Template template arguments (C++ only)
Class templates (C++ only)
Class template declarations and definitions (C++ only)
Static data members and templates (C++ only)
Member functions of class templates (C++ only)
Friends and templates (C++ only)
Function templates (C++ only)
Template argument deduction (C++ only)
Deducing type template arguments
Deducing non-type template arguments
Overloading function templates (C++ only)
Partial ordering of function templates (C++ only)
Template instantiation (C++ only)
Implicit instantiation (C++ only)
Explicit instantiation (C++ only)
Template specialization (C++ only)
Explicit specialization (C++ only)
Definition and declaration of explicit specializations
Explicit specialization and scope
Class members of explicit specializations
Explicit specialization of function templates
Explicit specialization of members of class templates
Partial specialization (C++ only)
Template parameter and argument lists of partial specializations
Matching of class template partial specializations
Name binding and dependent names (C++ only)
The typename keyword (C++ only)
The template keyword as qualifier (C++ only)
Exception handling (C++ only)
try blocks (C++ only)
Nested try blocks (C++ only)
catch blocks (C++ only)
Function try block handlers (C++ only)
Arguments of catch blocks (C++ only)
Matching between exceptions thrown and caught (C++ only)
Order of catching (C++ only)
throw expressions (C++ only)
Rethrowing an exception (C++ only)
Stack unwinding (C++ only)
Exception specifications (C++ only)
Special exception handling functions (C++ only)
The unexpected() function (C++ only)
The terminate() function (C++ only)
The set_unexpected() and set_terminate() functions (C++ only)
Example using the exception handling functions (C++ only)
Preprocessor directives
Macro definition directives
The #define directive
Object-like macros
Function-like macros
Variadic macro extensions
The #undef directive
The # operator
The ## operator
File inclusion directives
The #include directive
Using the #include Directive when Compiling Source in a Data Management File
Using the #include Directive When Compiling Source in an Integrated File System File
The #include_next directive
Conditional compilation directives
The #if and #elif directives
The #ifdef directive
The #ifndef directive
The #else directive
The #endif directive
Message generation directives
The #error directive
The #warning directive
The #line directive
Assertion directives
The null directive (#)
Pragma directives
The _Pragma preprocessing operator
Appendix A. The ILE C language extensions
C99 features as extensions to C89
Extensions for GNU C compatibility
Extensions for decimal floating-point support
Appendix B. The ILE C++ language extensions
General IBM extensions
Extensions for C99 compatibility
Extensions for GNU C compatibility
Extensions for GNU C++ compatibility
Extensions for decimal floating-point support
Notices
Programming Interface Information
Trademarks and Service Marks
Industry Standards
Index


[ Top of Page | Previous Page | Next Page | Contents | Index ]