TSCLANGU.PDF

(474 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 L
ANGUAGE
R
EFERENCE
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 ............................................................... 9
Introduction ...........................................................................................................9
Notation .........................................................................................................10
C
HAPTER
2 ............................................................. 11
Program structure................................................................................................11
Introduction ....................................................................................................11
Program Startup ............................................................................................11
Names ...........................................................................................................12
Scopes of Identifiers ......................................................................................13
Linkages of Identifiers ....................................................................................14
Name Spaces for Identifiers ..........................................................................15
Storage Durations of Objects .........................................................................16
C
HAPTER
3 ............................................................. 17
C Language Elements .........................................................................................17
Character Sets ...............................................................................................17
Source and Target character sets ..................................................................18
Trigraph Sequences .......................................................................................18
Escape Sequences ........................................................................................19
Numerical Representation of Characters.......................................................20
Lexical Elements............................................................................................21
Keywords .......................................................................................................21
Identifiers .......................................................................................................22
Operators .......................................................................................................23
Punctuators ...................................................................................................23
Comments .....................................................................................................23
C
HAPTER
4 ............................................................. 25
Types and Constants ...........................................................................................25
Types .............................................................................................................25
Declarations .............................................................................................25
4
T
OP
S
PEED
C L
ANGUAGE
R
EFERENCE
Object Types ............................................................................................26
Function Types .........................................................................................30
Incomplete Types .....................................................................................30
Qualified Types.........................................................................................30
Composite Type .......................................................................................31
Constants .................................................................................................31
Floating Constants ...................................................................................32
Integer Constants .....................................................................................33
Enumeration Constants ...........................................................................35
Character Constants ................................................................................35
String Literals .................................................................................................37
C
HAPTER
5 ............................................................. 39
Conversions ........................................................................................................39
Introduction ....................................................................................................39
Arithmetic Operands ......................................................................................39
Characters and Integers ..........................................................................39
Integral Promotions ..................................................................................40
Effects of conversions ....................................................................................41
Signed and Unsigned Integers .................................................................41
Effects of conversions ..............................................................................43
Floating and Integral Values .....................................................................43
Floating Point Values ................................................................................44
Usual Arithmetic Conversions ..................................................................45
Conversions Involving Other Operands .........................................................46
Lvalues and Function Designators ...........................................................46
void Values ...............................................................................................47
Pointers ....................................................................................................47
C
HAPTER
6 ............................................................. 48
Declarations ........................................................................................................48
Introduction ....................................................................................................48
Storage-Class Specifiers ...............................................................................49
Type Specifiers ..............................................................................................50
L
ANGUAGE
R
EFERENCE
5
struct and union Specifiers ............................................................................52
Bit Fields ........................................................................................................53
Structure and Union Tags .........................................................................55
Enumeration Specifiers..................................................................................56
Type Qualifiers ...............................................................................................58
Declarators ....................................................................................................59
Pointer Declarators ........................................................................................60
Relative Pointers ......................................................................................61
Array Declarators ...........................................................................................61
Function Declarators .....................................................................................63
Declarators with Special Keywords ................................................................66
Variable Declarations ...............................................................................66
Pointer Declarations .................................................................................67
Function Declarations ..............................................................................68
The inline Keyword ...................................................................................68
Type Names...................................................................................................69
Type Definitions and Type Equivalence .........................................................70
Function Definitions .......................................................................................72
Initialization .........................................................................................................74
Initializing Arrays, Structures and Unions ......................................................75
Initializing Multidimensional Arrays ..........................................................77
Initializing Strings .....................................................................................79
Initializing Functions ......................................................................................79
External Definitions........................................................................................80
External Object Definitions.......................................................................81
C
HAPTER
7 ............................................................. 83
Expressions.........................................................................................................83
Introduction ....................................................................................................83
Precedence of Operators...............................................................................85
Primary Expressions .....................................................................................86
Postfix Operators ...........................................................................................87
Array Subscripting ....................................................................................87
Function Calls ................................................................................................88
Zgłoś jeśli naruszono regulamin