TSCLANG2.PDF

(975 KB) Pobierz
L
ANGUAGE
R
EFERENCE
1
TopSpeed
®
C++
For IBM
®
Personal Computers and Compatibles
Language Reference
TopSpeed Corporation
2
T
OP
S
PEED
C++™
Copyright
©
1990-1991, by TopSpeed Corporation. All rights reserved.
TopSpeed
®
is a registered trademark of TopSpeed Corporation.
Other brand or product names are trademarks or registered trademarks of their respective holders.
Printed in the United Kingdom.
10
9
8
7
6
5
4
3
2
1
L
ANGUAGE
R
EFERENCE
3
Contents
C
HAPTER
1
I
NTRODUCTION
..................................................... 10
Notation .........................................................................................................11
C
HAPTER
2
B
ASIC
C
ONCEPTS
................................................ 12
Introduction ....................................................................................................12
Names ...........................................................................................................12
Declarations and Definitions ..........................................................................13
Scopes of Identifiers ......................................................................................13
Linkages of Identifiers ....................................................................................14
Storage Durations of Objects .........................................................................16
Fundamental Types .......................................................................................16
Derived Types ................................................................................................18
Lvalues ..........................................................................................................19
Typedef Names ..............................................................................................19
Program Startup ............................................................................................20
C
HAPTER
3
C++ L
EXICAL
T
OKENS
.......................................... 22
Tokens ...........................................................................................................22
Literals ...........................................................................................................25
Floating Constants .........................................................................................25
Character Constants ......................................................................................28
C
HAPTER
4
C
ONVERSIONS
..................................................... 32
Introduction ....................................................................................................32
Arithmetic Operands ......................................................................................32
4
T
OP
S
PEED
C++™
C
HAPTER
5
D
ECLARATIONS
.................................................... 37
Introduction ....................................................................................................37
Declaration Specifiers ....................................................................................38
Storage-Class Specifiers ...............................................................................39
Function Specifiers ........................................................................................40
Typedef Declarations .....................................................................................40
Elaborated Type Specifiers ............................................................................42
Asm Declarations ..........................................................................................44
Linkage Specifications ...................................................................................44
C
HAPTER
6
D
ECLARATORS
..................................................... 47
Introduction ....................................................................................................47
Pointer Declarators ........................................................................................48
Reference Declarators ...................................................................................49
Pointer-to-Member Declarators......................................................................50
Array Declarators ...........................................................................................51
Function Declarators .....................................................................................52
Declarators with Special Keywords ................................................................55
Abstract Declarators and Type Names ..........................................................57
Function Definitions .......................................................................................58
Initialization ....................................................................................................59
Initializing Aggregates ...................................................................................60
Initializing Multidimensional Arrays ................................................................61
Initializing Strings ...........................................................................................63
Initializing References....................................................................................63
Initializing Functions ......................................................................................64
Declaration Ambiguities .................................................................................65
C
HAPTER
7
E
XPRESSIONS
...................................................... 66
Introduction ....................................................................................................66
Precedence of Operators...............................................................................68
L
ANGUAGE
R
EFERENCE
5
Primary Expressions .....................................................................................69
Postfix Operators ...........................................................................................70
Explicit Type Conversion (Function Notation) ................................................73
Member Selection Operators .........................................................................73
Postfix Increment and Decrement Operators.................................................74
Unary Operators ............................................................................................75
Prefix Increment and Decrement Operators ..................................................75
Unary Arithmetic Operators ...........................................................................77
The sizeof Operator .......................................................................................78
The new Operator ..........................................................................................79
The delete Operator ......................................................................................81
Cast Expressions ...........................................................................................82
Pointer-to-Member Operators ........................................................................84
Multiplicative Operators .................................................................................85
Additive Operators .........................................................................................86
Bitwise Shift Operators ..................................................................................86
Relational Operators ......................................................................................87
Equality Operators .........................................................................................88
Bitwise AND Operator....................................................................................89
Bitwise Exclusive OR Operator ......................................................................89
Bitwise Inclusive OR Operator .......................................................................90
Logical AND Operator ...................................................................................90
Logical OR Operator ......................................................................................90
Conditional Operator .....................................................................................91
Assignment Operators ...................................................................................92
Simple Assignment ........................................................................................92
Compound Assignment .................................................................................93
Comma Operator ...........................................................................................94
Constant Expressions ....................................................................................95
C
HAPTER
8
S
TATEMENTS
....................................................... 97
Introduction ....................................................................................................97
Labeled Statements .......................................................................................97
Zgłoś jeśli naruszono regulamin