Modifying the
outside object...................149
Introduction to
C++ references ................151
Pointers and references
as modifiers .....................153
Scoping................155
Defining variables
on the fly.........................156
Specifying storage
allocation..............159
Global variables................159
Local variables..................161
static...............................161
extern .............................163
Constants ........................165
volatile ............................167
Operators and
their use...............168
Assignment......................168
Mathematical operators .....169
Relational operators ..........171
Logical operators ..............171
Bitwise operators..............172
Shift operators .................173
Unary operators................176
The ternary operator .........177
The comma operator .........178
Common pitfalls
when using operators........179
Casting operators..............179
C++ explicit casts.............181
sizeof – an operator
by itself ...........................186
The asm keyword..............187
Explicit operators..............187
Composite type
creation................188
Aliasing names
with typedef.....................188
Combining variables
with struct .......................189
Clarifying programs
with enum........................192
Saving memory
with union........................195
Arrays .............................196
Debugging hints ....208
Debugging flags................208
Turning variables and
expressions into strings .....211
The C assert( ) macro........212
Function
addresses.............213
Defining a
function pointer................ 213
Complicated declarations
& definitions..................... 214
Using a function pointer ....215
Arrays of pointers
to functions .....................216
Make: managing
separate
compilation...........217
Make activities ................. 219
Makefiles in this book........ 222
An example makefile......... 223
Summary .............226
Exercises..............226
4: Data Abstraction 233
A tiny C-like
library..................235
Dynamic
storage allocation ............. 239
Bad guesses .................... 244
What's wrong? ......246
The basic object....247
What's an object?..255
Abstract
data typing...........256
Object details........257
Header file
etiquette ..............259
Importance of
header files...................... 260
The multiple-declaration
problem ..........................262
The preprocessor directives
#define, #ifdef,
and #endif....................... 263
A standard for header files. 264
Namespaces in headers..... 265
Using headers in projects ..266
Nested structures..266
Global scope resolution ..... 271
Summary .............271